From 96794064b20917436ce73aedf015a9d53e8d00fb Mon Sep 17 00:00:00 2001 From: Fahad Israr Date: Tue, 2 Jul 2019 12:21:29 +0530 Subject: Custom Modules Added --- modules/fahad/article/article.info.yml | 16 ++++++++ modules/fahad/article/article.module | 35 ++++++++++++++++ modules/fahad/article/composer.json | 14 +++++++ .../field.storage.node.field_article_link.yml | 22 +++++++++++ modules/fahad/article/templates/article.html.twig | 1 + .../article/tests/src/Functional/LoadTest.php | 46 ++++++++++++++++++++++ 6 files changed, 134 insertions(+) create mode 100644 modules/fahad/article/article.info.yml create mode 100644 modules/fahad/article/article.module create mode 100644 modules/fahad/article/composer.json create mode 100644 modules/fahad/article/config/install/field.storage.node.field_article_link.yml create mode 100644 modules/fahad/article/templates/article.html.twig create mode 100644 modules/fahad/article/tests/src/Functional/LoadTest.php (limited to 'modules/fahad/article') diff --git a/modules/fahad/article/article.info.yml b/modules/fahad/article/article.info.yml new file mode 100644 index 0000000..49c0771 --- /dev/null +++ b/modules/fahad/article/article.info.yml @@ -0,0 +1,16 @@ +name: 'article' +type: module +description: 'My Awesome Module' +core: 8.x +package: 'Custom' +dependencies: + - drupal:comment + - drupal:image + - drupal:link + - drupal:path + - drupal:text + - drupal:user + - drupal:node + - drupal:taxonomy + + \ No newline at end of file diff --git a/modules/fahad/article/article.module b/modules/fahad/article/article.module new file mode 100644 index 0000000..f367abe --- /dev/null +++ b/modules/fahad/article/article.module @@ -0,0 +1,35 @@ +' . t('About') . ''; + $output .= '

' . t('My Awesome Module') . '

'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function article_theme() { + return [ + 'article' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/fahad/article/composer.json b/modules/fahad/article/composer.json new file mode 100644 index 0000000..7088212 --- /dev/null +++ b/modules/fahad/article/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/article", + "type": "drupal-module", + "description": "My Awesome Module", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/article", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/article", + "source": "http://cgit.drupalcode.org/article" + }, + "require": { } +} diff --git a/modules/fahad/article/config/install/field.storage.node.field_article_link.yml b/modules/fahad/article/config/install/field.storage.node.field_article_link.yml new file mode 100644 index 0000000..b8f5a5b --- /dev/null +++ b/modules/fahad/article/config/install/field.storage.node.field_article_link.yml @@ -0,0 +1,22 @@ +uuid: 1d56f0f0-900c-47bb-8b59-47f0c7c531c7 +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - article +id: node.field_article_link +field_name: field_article_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/fahad/article/templates/article.html.twig b/modules/fahad/article/templates/article.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/fahad/article/templates/article.html.twig @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/fahad/article/tests/src/Functional/LoadTest.php b/modules/fahad/article/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..5607b01 --- /dev/null +++ b/modules/fahad/article/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +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('')); + $this->assertSession()->statusCodeEquals(200); + } + +} -- cgit