class TestControllers
Same name in this branch
- 11.x core/modules/system/tests/modules/menu_test/src/TestControllers.php \Drupal\menu_test\TestControllers
- 11.x core/modules/system/tests/modules/router_test_directory/src/TestControllers.php \Drupal\router_test\TestControllers
Same name in other branches
- 9 core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php \Drupal\paramconverter_test\TestControllers
- 9 core/modules/system/tests/modules/menu_test/src/TestControllers.php \Drupal\menu_test\TestControllers
- 9 core/modules/system/tests/modules/router_test_directory/src/TestControllers.php \Drupal\router_test\TestControllers
- 8.9.x core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php \Drupal\paramconverter_test\TestControllers
- 8.9.x core/modules/system/tests/modules/menu_test/src/TestControllers.php \Drupal\menu_test\TestControllers
- 8.9.x core/modules/system/tests/modules/router_test_directory/src/TestControllers.php \Drupal\router_test\TestControllers
- 10 core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php \Drupal\paramconverter_test\TestControllers
- 10 core/modules/system/tests/modules/menu_test/src/TestControllers.php \Drupal\menu_test\TestControllers
- 10 core/modules/system/tests/modules/router_test_directory/src/TestControllers.php \Drupal\router_test\TestControllers
Controller routine for testing the paramconverter.
Hierarchy
- class \Drupal\paramconverter_test\TestControllers
Expanded class hierarchy of TestControllers
File
-
core/
modules/ system/ tests/ modules/ paramconverter_test/ src/ TestControllers.php, line 13
Namespace
Drupal\paramconverter_testView source
class TestControllers {
public function testUserNodeFoo(EntityInterface $user, NodeInterface $node, $foo) {
$foo = is_object($foo) ? $foo->label() : $foo;
return [
'#markup' => "user: {$user->label()}, node: {$node->label()}, foo: {$foo}",
];
}
public function testNodeSetParent(NodeInterface $node, NodeInterface $parent) {
return [
'#markup' => "Setting '{$parent->label()}' as parent of '{$node->label()}'.",
];
}
public function testEntityLanguage(NodeInterface $node) {
$build = [
'#markup' => $node->label(),
];
\Drupal::service('renderer')->addCacheableDependency($build, $node);
return $build;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
TestControllers::testEntityLanguage | public | function | |
TestControllers::testNodeSetParent | public | function | |
TestControllers::testUserNodeFoo | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.