summaryrefslogtreecommitdiff
path: root/modules/fahad/article
diff options
context:
space:
mode:
authorNitesh Kumar Sinha2019-07-02 17:40:53 +0530
committerGitHub2019-07-02 17:40:53 +0530
commit58dbf8fcb04c01c338b9e346b8266690c8b92a2f (patch)
treeab16a85a8213c31f2abaf34e9d7df44a0f7132ac /modules/fahad/article
parentc63a20a2e293cb104027480a5770406e3f17c514 (diff)
parent0d50e51638dac37bb5133b5024f2e44811e2745e (diff)
downloadacadmix_distribution-58dbf8fcb04c01c338b9e346b8266690c8b92a2f.tar.gz
acadmix_distribution-58dbf8fcb04c01c338b9e346b8266690c8b92a2f.tar.bz2
acadmix_distribution-58dbf8fcb04c01c338b9e346b8266690c8b92a2f.zip
Merge pull request #15 from FOSSEE/stage
merging Stage into master
Diffstat (limited to 'modules/fahad/article')
-rw-r--r--modules/fahad/article/article.info.yml16
-rw-r--r--modules/fahad/article/article.module35
-rw-r--r--modules/fahad/article/composer.json14
-rw-r--r--modules/fahad/article/config/install/field.storage.node.field_article_link.yml22
-rw-r--r--modules/fahad/article/templates/article.html.twig1
-rw-r--r--modules/fahad/article/tests/src/Functional/LoadTest.php46
6 files changed, 134 insertions, 0 deletions
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 @@
+<?php
+
+/**
+ * @file
+ * Contains article.module.
+ */
+
+use Drupal\Core\Routing\RouteMatchInterface;
+
+/**
+ * Implements hook_help().
+ */
+function article_help($route_name, RouteMatchInterface $route_match) {
+ switch ($route_name) {
+ // Main module help for the article module.
+ case 'help.page.article':
+ $output = '';
+ $output .= '<h3>' . t('About') . '</h3>';
+ $output .= '<p>' . t('My Awesome Module') . '</p>';
+ 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 @@
+<!-- Add you custom twig html here --> \ 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 @@
+<?php
+
+namespace Drupal\Tests\article\Functional;
+
+use Drupal\Core\Url;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Simple test to ensure that main page loads with module enabled.
+ *
+ * @group article
+ */
+class LoadTest extends BrowserTestBase {
+
+ /**
+ * Modules to enable.
+ *
+ * @var array
+ */
+ public static $modules = ['article'];
+
+ /**
+ * 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);
+ }
+
+}