diff options
Diffstat (limited to 'modules/mansimran/student_clubs')
19 files changed, 968 insertions, 0 deletions
diff --git a/modules/mansimran/student_clubs/composer.json b/modules/mansimran/student_clubs/composer.json new file mode 100755 index 0000000..3c4d6b7 --- /dev/null +++ b/modules/mansimran/student_clubs/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/student_clubs", + "type": "drupal-module", + "description": "My Awesome Module", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/student_clubs", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/student_clubs", + "source": "http://cgit.drupalcode.org/student_clubs" + }, + "require": { } +} diff --git a/modules/mansimran/student_clubs/config/install/core.entity_form_display.node.club_and_chapter.default.yml b/modules/mansimran/student_clubs/config/install/core.entity_form_display.node.club_and_chapter.default.yml new file mode 100755 index 0000000..e08e012 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/core.entity_form_display.node.club_and_chapter.default.yml @@ -0,0 +1,115 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.club_and_chapter.body + - field.field.node.club_and_chapter.field_facebook_link + - field.field.node.club_and_chapter.field_logo_of_organisation + - field.field.node.club_and_chapter.field_organisation_category + - image.style.thumbnail + - node.type.club_and_chapter + module: + - image + - link + - path + - text + enforced: + module: + - student_clubs +id: node.club_and_chapter.default +targetEntityType: node +bundle: club_and_chapter +mode: default +content: + body: + type: text_textarea_with_summary + weight: 121 + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + third_party_settings: { } + region: content + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_facebook_link: + weight: 125 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_logo_of_organisation: + weight: 123 + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + type: image_image + region: content + field_organisation_category: + weight: 127 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + langcode: + type: language_select + weight: 2 + region: content + settings: + include_locked: true + third_party_settings: { } + path: + type: path + weight: 30 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + settings: + display_label: true + weight: 15 + region: content + third_party_settings: { } + status: + type: boolean_checkbox + settings: + display_label: true + weight: 120 + region: content + third_party_settings: { } + sticky: + type: boolean_checkbox + settings: + display_label: true + weight: 16 + region: content + third_party_settings: { } + title: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 5 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + region: content + third_party_settings: { } +hidden: { } diff --git a/modules/mansimran/student_clubs/config/install/core.entity_view_display.node.club_and_chapter.default.yml b/modules/mansimran/student_clubs/config/install/core.entity_view_display.node.club_and_chapter.default.yml new file mode 100755 index 0000000..7cf416f --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/core.entity_view_display.node.club_and_chapter.default.yml @@ -0,0 +1,65 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.club_and_chapter.body + - field.field.node.club_and_chapter.field_facebook_link + - field.field.node.club_and_chapter.field_logo_of_organisation + - field.field.node.club_and_chapter.field_organisation_category + - node.type.club_and_chapter + module: + - image + - link + - text + - user + enforced: + module: + - student_clubs +id: node.club_and_chapter.default +targetEntityType: node +bundle: club_and_chapter +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_facebook_link: + weight: 105 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_logo_of_organisation: + weight: 103 + label: hidden + settings: + image_style: '' + image_link: '' + third_party_settings: { } + type: image + region: content + field_organisation_category: + weight: 107 + label: hidden + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + links: + weight: 100 + region: content + settings: { } + third_party_settings: { } +hidden: + langcode: true diff --git a/modules/mansimran/student_clubs/config/install/core.entity_view_display.node.club_and_chapter.teaser.yml b/modules/mansimran/student_clubs/config/install/core.entity_view_display.node.club_and_chapter.teaser.yml new file mode 100755 index 0000000..c9112c6 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/core.entity_view_display.node.club_and_chapter.teaser.yml @@ -0,0 +1,39 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.club_and_chapter.body + - field.field.node.club_and_chapter.field_facebook_link + - field.field.node.club_and_chapter.field_logo_of_organisation + - field.field.node.club_and_chapter.field_organisation_category + - node.type.club_and_chapter + module: + - text + - user + enforced: + module: + - student_clubs +id: node.club_and_chapter.teaser +targetEntityType: node +bundle: club_and_chapter +mode: teaser +content: + body: + label: hidden + type: text_summary_or_trimmed + weight: 100 + settings: + trim_length: 600 + third_party_settings: { } + region: content + links: + weight: 101 + region: content + settings: { } + third_party_settings: { } +hidden: + field_facebook_link: true + field_logo_of_organisation: true + field_organisation_category: true + langcode: true diff --git a/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.body.yml b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.body.yml new file mode 100755 index 0000000..246a310 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.club_and_chapter + module: + - text + enforced: + module: + - student_clubs +id: node.club_and_chapter.body +field_name: body +entity_type: node +bundle: club_and_chapter +label: Body +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true +field_type: text_with_summary diff --git a/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_facebook_link.yml b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_facebook_link.yml new file mode 100755 index 0000000..f2c9f9c --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_facebook_link.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_facebook_link + - node.type.club_and_chapter + module: + - link + enforced: + module: + - student_clubs +id: node.club_and_chapter.field_facebook_link +field_name: field_facebook_link +entity_type: node +bundle: club_and_chapter +label: 'Facebook Link' +description: 'Link to Facebook page' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_logo_of_organisation.yml b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_logo_of_organisation.yml new file mode 100755 index 0000000..0d04a2c --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_logo_of_organisation.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_logo_of_organisation + - node.type.club_and_chapter + module: + - image + enforced: + module: + - student_clubs +id: node.club_and_chapter.field_logo_of_organisation +field_name: field_logo_of_organisation +entity_type: node +bundle: club_and_chapter +label: 'logo of organisation' +description: 'Logo of the organisation' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: clubs + file_extensions: 'png gif jpg jpeg' + max_filesize: '' + max_resolution: '' + min_resolution: '' + alt_field: true + alt_field_required: true + title_field: false + title_field_required: false + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + handler: 'default:file' + handler_settings: { } +field_type: image diff --git a/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_organisation_category.yml b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_organisation_category.yml new file mode 100755 index 0000000..5f2b3ac --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/field.field.node.club_and_chapter.field_organisation_category.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_organisation_category + - node.type.club_and_chapter + - taxonomy.vocabulary.category_of_organisation + enforced: + module: + - student_clubs +id: node.club_and_chapter.field_organisation_category +field_name: field_organisation_category +entity_type: node +bundle: club_and_chapter +label: 'organisation category' +description: 'The category the organisation belongs to' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + category_of_organisation: category_of_organisation + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/mansimran/student_clubs/config/install/field.storage.node.field_facebook_link.yml b/modules/mansimran/student_clubs/config/install/field.storage.node.field_facebook_link.yml new file mode 100755 index 0000000..05130d9 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/field.storage.node.field_facebook_link.yml @@ -0,0 +1,22 @@ +uuid: 917eb7d1-49da-4380-9a0b-77420dde9291 +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - student_clubs +id: node.field_facebook_link +field_name: field_facebook_link +entity_type: node +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/student_clubs/config/install/field.storage.node.field_logo_of_organisation.yml b/modules/mansimran/student_clubs/config/install/field.storage.node.field_logo_of_organisation.yml new file mode 100755 index 0000000..544b5bf --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/field.storage.node.field_logo_of_organisation.yml @@ -0,0 +1,33 @@ +uuid: 27f5a0a1-f8e2-42ec-93e1-ee75b849a3ee +langcode: en +status: true +dependencies: + module: + - file + - image + - node + enforced: + module: + - student_clubs +id: node.field_logo_of_organisation +field_name: field_logo_of_organisation +entity_type: node +type: image +settings: + uri_scheme: public + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + target_type: file + display_field: false + display_default: false +module: image +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/student_clubs/config/install/field.storage.node.field_organisation_category.yml b/modules/mansimran/student_clubs/config/install/field.storage.node.field_organisation_category.yml new file mode 100755 index 0000000..3d57205 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/field.storage.node.field_organisation_category.yml @@ -0,0 +1,23 @@ +uuid: 5baf6269-cae5-4f3f-a820-4793dc32036e +langcode: en +status: true +dependencies: + module: + - node + - taxonomy + enforced: + module: + - student_clubs +id: node.field_organisation_category +field_name: field_organisation_category +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/student_clubs/config/install/migrate_plus.migration.clubs_1.yml b/modules/mansimran/student_clubs/config/install/migrate_plus.migration.clubs_1.yml new file mode 100644 index 0000000..d516c01 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/migrate_plus.migration.clubs_1.yml @@ -0,0 +1,61 @@ +uuid: 9a260262-706e-4344-9798-3c4e4f0ef0c4 +langcode: en +id: clubs_1 +status: true +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - CSV +migration_group: default +label: 'clubs_csv_import1' +source: + plugin: csv + path: /home/mansimran/Desktop/mansimran1/clubs1.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/migrationdata/clubs + file_dest: 'public://clubs/' +process: + type: + plugin: default_value + default_value: club_and_chapter + source_path: + - + plugin: skip_on_empty + method: process + source: logo + - + plugin: concat + delimiter: / + source: + - constants/file_source + - logo + title: title + body/value: body + body/format: + plugin: default_value + default_value: basic_html + field_logo_of_organisation: + plugin: file_import + source: '@source_path' + destination: constants/file_dest + field_facebook_link/uri: fb_link + field_facebook_link/title: + plugin: default_value + default_value: 'Fb Link' + field_organisation_category: + plugin: entity_lookup + entity_type: taxonomy_term + bundle: category_of_organisation + source: organisation_category +destination: + plugin: 'entity:node' + bundle: club_and_chapter +migration_dependencies: + required: { } + optional: { } diff --git a/modules/mansimran/student_clubs/config/install/node.type.club_and_chapter.yml b/modules/mansimran/student_clubs/config/install/node.type.club_and_chapter.yml new file mode 100755 index 0000000..043bbe0 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/node.type.club_and_chapter.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - student_clubs +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Student Clubs' +type: club_and_chapter +description: 'Clubs in VIT' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/mansimran/student_clubs/config/install/views.view.student_clubs.yml b/modules/mansimran/student_clubs/config/install/views.view.student_clubs.yml new file mode 100644 index 0000000..0620368 --- /dev/null +++ b/modules/mansimran/student_clubs/config/install/views.view.student_clubs.yml @@ -0,0 +1,331 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_logo_of_organisation + - field.storage.node.field_organisation_category + - node.type.club_and_chapter + module: + - image + - node + - user + enforced: + module: + - student_clubs +id: student_clubs +label: 'Student Clubs' +module: views +description: 'Various Student Clubs of VIT' +tag: '' +base_table: node_field_data +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + query: + type: views_query + options: + disable_sql_rewrite: false + distinct: false + replica: false + query_comment: '' + query_tags: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: mini + options: + items_per_page: 5 + offset: 0 + id: 0 + total_pages: null + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + tags: + previous: ‹‹ + next: ›› + style: + type: default + row: + type: fields + options: + default_field_elements: true + inline: { } + separator: '' + hide_empty: false + fields: + title: + id: title + table: node_field_data + field: title + entity_type: node + entity_field: title + label: '' + alter: + alter_text: false + make_link: false + absolute: false + trim: false + word_boundary: false + ellipsis: false + strip_tags: false + html: false + hide_empty: false + empty_zero: false + settings: + link_to_entity: true + plugin_id: field + relationship: none + group_type: group + admin_label: '' + exclude: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_alter_empty: true + click_sort_column: value + type: string + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_organisation_category: + id: field_organisation_category + table: node__field_organisation_category + field: field_organisation_category + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + plugin_id: field + field_logo_of_organisation: + id: field_logo_of_organisation + table: node__field_logo_of_organisation + field: field_logo_of_organisation + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: image + settings: + image_style: '' + image_link: '' + group_column: '' + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + plugin_id: field + filters: + status: + value: '1' + table: node_field_data + field: status + plugin_id: boolean + entity_type: node + entity_field: status + id: status + expose: + operator: '' + group: 1 + type: + id: type + table: node_field_data + field: type + value: + club_and_chapter: club_and_chapter + entity_type: node + entity_field: type + plugin_id: bundle + sorts: + created: + id: created + table: node_field_data + field: created + order: DESC + entity_type: node + entity_field: created + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exposed: false + expose: + label: '' + granularity: second + title: 'Student Clubs' + header: { } + footer: { } + empty: { } + relationships: { } + arguments: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.field_logo_of_organisation' + - 'config:field.storage.node.field_organisation_category' + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: 1 + display_options: + display_extenders: { } + path: student-clubs + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.field_logo_of_organisation' + - 'config:field.storage.node.field_organisation_category' + diff --git a/modules/mansimran/student_clubs/student_clubs.info.yml b/modules/mansimran/student_clubs/student_clubs.info.yml new file mode 100755 index 0000000..651ed7d --- /dev/null +++ b/modules/mansimran/student_clubs/student_clubs.info.yml @@ -0,0 +1,16 @@ +name: 'Student Clubs' +type: module +description: 'My Awesome Module' +core: 8.x +package: 'Custom' +dependencies: + - drupal:node + - drupal:menu_ui + - drupal:taxonomy + - drupal:file + - drupal:image + - drupal:link + - drupal:text + - drupal:user + - drupal:path + diff --git a/modules/mansimran/student_clubs/student_clubs.install b/modules/mansimran/student_clubs/student_clubs.install new file mode 100644 index 0000000..46d2066 --- /dev/null +++ b/modules/mansimran/student_clubs/student_clubs.install @@ -0,0 +1,27 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function student_clubs_uninstall() { + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'club_and_chapter'); + $nids = $query->execute(); + + + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} + diff --git a/modules/mansimran/student_clubs/student_clubs.module b/modules/mansimran/student_clubs/student_clubs.module new file mode 100755 index 0000000..54b221f --- /dev/null +++ b/modules/mansimran/student_clubs/student_clubs.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains student_clubs.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function student_clubs_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the student_clubs module. + case 'help.page.student_clubs': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('My Awesome Module') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function student_clubs_theme() { + return [ + 'student_clubs' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/mansimran/student_clubs/templates/student-clubs.html.twig b/modules/mansimran/student_clubs/templates/student-clubs.html.twig new file mode 100755 index 0000000..91e43c8 --- /dev/null +++ b/modules/mansimran/student_clubs/templates/student-clubs.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/mansimran/student_clubs/tests/src/Functional/LoadTest.php b/modules/mansimran/student_clubs/tests/src/Functional/LoadTest.php new file mode 100755 index 0000000..2d4cfeb --- /dev/null +++ b/modules/mansimran/student_clubs/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\student_clubs\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group student_clubs + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['student_clubs']; + + /** + * A user with permission to administer site configuration. + * + * @var \Drupal\user\UserInterface + */ + protected $user; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->user = $this->drupalCreateUser(['administer site configuration']); + $this->drupalLogin($this->user); + } + + /** + * Tests that the home page loads with a 200 response. + */ + public function testLoad() { + $this->drupalGet(Url::fromRoute('<front>')); + $this->assertSession()->statusCodeEquals(200); + } + +} |