Generated opencase and opencase_entities modules

This commit is contained in:
naomi 2018-04-29 09:22:16 +02:00
commit 03846a27f7
10 changed files with 202 additions and 0 deletions

14
composer.json Normal file
View 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": { }
}

View 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": { }
}

View File

@ -0,0 +1,5 @@
name: 'OpenCase Entities'
type: module
description: 'Entities used in OpenCase'
core: 8.x
package: 'OpenCase'

View 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',
],
];
}

View File

@ -0,0 +1 @@
<!-- Add you custom twig html here -->

View 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
View File

@ -0,0 +1,5 @@
name: 'OpenCase'
type: module
description: 'Simple Case Management'
core: 8.x
package: 'OpenCase'

35
opencase.module Normal file
View 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',
],
];
}

View File

@ -0,0 +1 @@
<!-- Add you custom twig html here -->

View 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);
}
}