Generated OpenCase Search module

This commit is contained in:
naomi 2018-04-29 14:38:10 +02:00
parent 249003bf16
commit 4b7f983b27
5 changed files with 105 additions and 0 deletions

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

View 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

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

View File

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

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