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