Generated opencase and opencase_entities modules
This commit is contained in:
commit
03846a27f7
14
composer.json
Normal file
14
composer.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "drupal/opencase",
|
||||
"type": "drupal-module",
|
||||
"description": "Simple Case Management",
|
||||
"keywords": ["Drupal"],
|
||||
"license": "GPL-2.0+",
|
||||
"homepage": "https://www.drupal.org/project/opencase",
|
||||
"minimum-stability": "dev",
|
||||
"support": {
|
||||
"issues": "https://www.drupal.org/project/issues/opencase",
|
||||
"source": "http://cgit.drupalcode.org/opencase"
|
||||
},
|
||||
"require": { }
|
||||
}
|
14
modules/opencase_entities/composer.json
Normal file
14
modules/opencase_entities/composer.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "drupal/opencase_entities",
|
||||
"type": "drupal-module",
|
||||
"description": "Entities used in OpenCase",
|
||||
"keywords": ["Drupal"],
|
||||
"license": "GPL-2.0+",
|
||||
"homepage": "https://www.drupal.org/project/opencase_entities",
|
||||
"minimum-stability": "dev",
|
||||
"support": {
|
||||
"issues": "https://www.drupal.org/project/issues/opencase_entities",
|
||||
"source": "http://cgit.drupalcode.org/opencase_entities"
|
||||
},
|
||||
"require": { }
|
||||
}
|
5
modules/opencase_entities/opencase_entities.info.yml
Normal file
5
modules/opencase_entities/opencase_entities.info.yml
Normal file
@ -0,0 +1,5 @@
|
||||
name: 'OpenCase Entities'
|
||||
type: module
|
||||
description: 'Entities used in OpenCase'
|
||||
core: 8.x
|
||||
package: 'OpenCase'
|
35
modules/opencase_entities/opencase_entities.module
Normal file
35
modules/opencase_entities/opencase_entities.module
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains opencase_entities.module.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
|
||||
/**
|
||||
* Implements hook_help().
|
||||
*/
|
||||
function opencase_entities_help($route_name, RouteMatchInterface $route_match) {
|
||||
switch ($route_name) {
|
||||
// Main module help for the opencase_entities module.
|
||||
case 'help.page.opencase_entities':
|
||||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('Entities used in OpenCase') . '</p>';
|
||||
return $output;
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme().
|
||||
*/
|
||||
function opencase_entities_theme() {
|
||||
return [
|
||||
'opencase_entities' => [
|
||||
'render element' => 'children',
|
||||
],
|
||||
];
|
||||
}
|
@ -0,0 +1 @@
|
||||
<!-- Add you custom twig html here -->
|
46
modules/opencase_entities/tests/src/Functional/LoadTest.php
Normal file
46
modules/opencase_entities/tests/src/Functional/LoadTest.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Tests\opencase_entities\Functional;
|
||||
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
|
||||
/**
|
||||
* Simple test to ensure that main page loads with module enabled.
|
||||
*
|
||||
* @group opencase_entities
|
||||
*/
|
||||
class LoadTest extends BrowserTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = ['opencase_entities'];
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
5
opencase.info.yml
Normal file
5
opencase.info.yml
Normal file
@ -0,0 +1,5 @@
|
||||
name: 'OpenCase'
|
||||
type: module
|
||||
description: 'Simple Case Management'
|
||||
core: 8.x
|
||||
package: 'OpenCase'
|
35
opencase.module
Normal file
35
opencase.module
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains opencase.module.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
|
||||
/**
|
||||
* Implements hook_help().
|
||||
*/
|
||||
function opencase_help($route_name, RouteMatchInterface $route_match) {
|
||||
switch ($route_name) {
|
||||
// Main module help for the opencase module.
|
||||
case 'help.page.opencase':
|
||||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('Simple Case Management') . '</p>';
|
||||
return $output;
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme().
|
||||
*/
|
||||
function opencase_theme() {
|
||||
return [
|
||||
'opencase' => [
|
||||
'render element' => 'children',
|
||||
],
|
||||
];
|
||||
}
|
1
templates/opencase.html.twig
Normal file
1
templates/opencase.html.twig
Normal file
@ -0,0 +1 @@
|
||||
<!-- Add you custom twig html here -->
|
46
tests/src/Functional/LoadTest.php
Normal file
46
tests/src/Functional/LoadTest.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Tests\opencase\Functional;
|
||||
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
|
||||
/**
|
||||
* Simple test to ensure that main page loads with module enabled.
|
||||
*
|
||||
* @group opencase
|
||||
*/
|
||||
class LoadTest extends BrowserTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = ['opencase'];
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user