Commit 25ee0ec9 authored by willzyx's avatar willzyx

Move the classes related to entities testing from devel_test to a dedicated module

parent a04b75b8
......@@ -21,7 +21,7 @@ class DevelControllerTest extends WebTestBase {
*
* @var array
*/
public static $modules = array('devel', 'node', 'entity_test', 'devel_test', 'block');
public static $modules = array('devel', 'node', 'entity_test', 'devel_entity_test', 'block');
/**
* {@inheritdoc}
......
devel_test.local_tasks:
deriver: 'Drupal\devel_test\Plugin\Derivative\DevelEntityTestLocalTasks'
devel_entity_test.local_tasks:
deriver: 'Drupal\devel_entity_test\Plugin\Derivative\DevelEntityTestLocalTasks'
......@@ -8,7 +8,7 @@
/**
* Implements hook_entity_view_mode_info_alter().
*/
function devel_test_entity_view_mode_info_alter(&$view_modes) {
function devel_entity_test_entity_view_mode_info_alter(&$view_modes) {
$entity_info = \Drupal::entityManager()->getDefinitions();
foreach ($entity_info as $entity_type => $info) {
if ($entity_info[$entity_type]->getProvider() == 'devel_entity_test_canonical' && !isset($view_modes[$entity_type])) {
......@@ -27,13 +27,3 @@ function devel_test_entity_view_mode_info_alter(&$view_modes) {
}
}
}
/**
* Implements hook_file_download().
*/
function devel_test_file_download($uri) {
$default_uri = \Drupal::state()->get('devel.test_file_download') ?: FALSE;
if ($default_uri === $uri) {
return array('X-Owned-By' => 'devel_test');
}
}
route_callbacks:
- '\Drupal\devel_entity_test\Routing\DevelEntityTestRoutes::routes'
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\devel_test\Entity\DevelEntityTestCanonical.
* Contains \Drupal\devel_entity_test\Entity\DevelEntityTestCanonical.
*/
namespace Drupal\devel_test\Entity;
namespace Drupal\devel_entity_test\Entity;
use Drupal\entity_test\Entity\EntityTest;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\devel_test\Entity\DevelEntityTestEdit.
* Contains \Drupal\devel_entity_test\Entity\DevelEntityTestEdit.
*/
namespace Drupal\devel_test\Entity;
namespace Drupal\devel_entity_test\Entity;
use Drupal\entity_test\Entity\EntityTest;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\devel_test\Entity\DevelEntityTestNoLinks.
* Contains \Drupal\devel_entity_test\Entity\DevelEntityTestNoLinks.
*/
namespace Drupal\devel_test\Entity;
namespace Drupal\devel_entity_test\Entity;
use Drupal\entity_test\Entity\EntityTest;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\devel_test\Plugin\Derivative\DevelEntityTestLocalTasks.
* Contains \Drupal\devel_entity_test\Plugin\Derivative\DevelEntityTestLocalTasks.
*/
namespace Drupal\devel_test\Plugin\Derivative;
namespace Drupal\devel_entity_test\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DeriverBase;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\devel_test\Routing\RouteSubscriber.
* Contains \Drupal\devel_entity_test\Routing\RouteSubscriber.
*/
namespace Drupal\devel_test\Routing;
namespace Drupal\devel_entity_test\Routing;
use Symfony\Component\Routing\Route;
......
name: 'Devel test module'
type: module
description: 'Support module for Devel testing.'
package: Testing
version: VERSION
core: 8.x
<?php
/**
* @file
* Support module for Devel testing.
*/
/**
* Implements hook_file_download().
*/
function devel_test_file_download($uri) {
$default_uri = \Drupal::state()->get('devel.test_file_download') ? : FALSE;
if ($default_uri === $uri) {
return array('X-Owned-By' => 'devel_test');
}
}
devel.simple_page:
path: '/devel/simple-page'
defaults:
_controller: '\Drupal\devel_test\Controller\DevelTestController::simplePage'
_title: 'Simple Page'
requirements:
_permission: 'access devel information'
devel.silent_global:
path: '/devel-silent/global-shoutdown'
defaults:
_controller: '\Drupal\devel_test\Controller\DevelSilentTestContoller::globalShoutdown'
_controller: '\Drupal\devel_test\Controller\DevelSilentTestController::globalShoutdown'
_title: 'Devel shoutdown'
requirements:
_permission: 'access devel information'
......@@ -9,7 +17,7 @@ devel.silent_global:
devel.silent_route_parameter:
path: '/devel-silent/route-requirement'
defaults:
_controller: '\Drupal\devel_test\Controller\DevelSilentTestContoller::develSilentRouteRequirement'
_controller: '\Drupal\devel_test\Controller\DevelSilentTestController::develSilentRouteRequirement'
_title: 'Devel settings'
requirements:
_permission: 'access devel information'
......@@ -18,10 +26,7 @@ devel.silent_route_parameter:
devel.silent_json:
path: '/devel-silent/json'
defaults:
_controller: '\Drupal\devel_test\Controller\DevelSilentTestContoller::jsonResponse'
_controller: '\Drupal\devel_test\Controller\DevelSilentTestController::jsonResponse'
_title: 'Devel settings'
requirements:
_permission: 'access devel information'
route_callbacks:
- '\Drupal\devel_test\Routing\DevelEntityTestRoutes::routes'
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\devel_test\Controller\DevelSilentTestContoller.
* Contains \Drupal\devel_test\Controller\DevelSilentTestController.
*/
namespace Drupal\devel_test\Controller;
......@@ -13,7 +13,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Returns responses for devel module routes.
*/
class DevelSilentTestContoller extends ControllerBase {
class DevelSilentTestController extends ControllerBase {
/**
* Tests that devel is disabled if $GLOBALS['devel_shutdown'] is set.
......
<?php
/**
* @file
* Contains \Drupal\devel_test\Controller\DevelTestController.
*/
namespace Drupal\devel_test\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Returns responses for devel module routes.
*/
class DevelTestController extends ControllerBase {
/**
* Returns a simple page output.
*
* @return array
* A render array.
*/
public function simplePage() {
return [
'#markup' => $this->t('Simple page'),
];
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment