diff --git a/core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php b/core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php index c5088e8..8a38b2a 100644 --- a/core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php +++ b/core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php @@ -73,7 +73,7 @@ public static function create(ContainerInterface $container) { * A string that can be used for comparison. */ public function menuTestCallback() { - return ['#markup' => 'This is the menuTestCallback content.']; + return ['#markup' => 'This is the menuTestCallback content.', '#cache' => []]; } @@ -114,7 +114,7 @@ public function themePage($inherited) { if ($inherited) { $output .= ' Theme negotiation inheritance is being tested.'; } - return ['#markup' => $output]; + return ['#markup' => $output, '#cache' => []]; } /** diff --git a/core/modules/system/tests/modules/menu_test/src/TestControllers.php b/core/modules/system/tests/modules/menu_test/src/TestControllers.php index a7e39e4..c14f2d4 100644 --- a/core/modules/system/tests/modules/menu_test/src/TestControllers.php +++ b/core/modules/system/tests/modules/menu_test/src/TestControllers.php @@ -18,21 +18,21 @@ class TestControllers { * Returns page to be used as a login path. */ public function testLogin() { - return ['#markup' => 'This is TestControllers::testLogin.']; + return ['#markup' => 'This is TestControllers::testLogin.', '#cache' => []]; } /** * Prints out test data. */ public function test1() { - return ['#markup' => 'test1']; + return ['#markup' => 'test1', '#cache' => []]; } /** * Prints out test data. */ public function test2() { - return ['#markup' => 'test2']; + return ['#markup' => 'test2', '#cache' => []]; } /** @@ -43,14 +43,14 @@ public function testSession() { $_SESSION['menu_test'] = 0; } $_SESSION['menu_test']++; - return ['#markup' => SafeMarkup::format('Session menu_test is @count', ['@count' => $_SESSION['menu_test']])]; + return ['#markup' => SafeMarkup::format('Session menu_test is @count', ['@count' => $_SESSION['menu_test']]), '#cache' => []]; } /** * Prints out test data. */ public function testDerived() { - return ['#markup' => 'testDerived']; + return ['#markup' => 'testDerived', '#cache' => []]; } /** @@ -64,10 +64,10 @@ public function testDerived() { */ public function testDefaults($placeholder = NULL) { if ($placeholder) { - return ['#markup' => SafeMarkup::format("Sometimes there is a placeholder: '@placeholder'.", array('@placeholder' => $placeholder))]; + return ['#markup' => SafeMarkup::format("Sometimes there is a placeholder: '@placeholder'.", array('@placeholder' => $placeholder)), '#cache' => []]; } else { - return ['#markup' => 'Sometimes there is no placeholder.']; + return ['#markup' => 'Sometimes there is no placeholder.', '#cache' => []]; } } @@ -77,6 +77,7 @@ public function testDefaults($placeholder = NULL) { public function testContextual() { return [ '#markup' => 'testContextual', + '#cache' => [], 'stuff' => [ '#type' => 'contextual_links', '#contextual_links' => [ diff --git a/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php b/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php index 327a8d5..76a20e3 100644 --- a/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php +++ b/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php @@ -17,15 +17,15 @@ 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"]; + return ['#markup' => "user: {$user->label()}, node: {$node->label()}, foo: $foo", '#cache' => []]; } public function testNodeSetParent(NodeInterface $node, NodeInterface $parent) { - return ['#markup' => "Setting '{$parent->label()}' as parent of '{$node->label()}'."]; + return ['#markup' => "Setting '{$parent->label()}' as parent of '{$node->label()}'.", '#cache' => []]; } public function testEntityLanguage(NodeInterface $node) { - $build = ['#markup' => $node->label()]; + $build = ['#markup' => $node->label(), '#cache' => []]; \Drupal::service('renderer')->addCacheableDependency($build, $node); return $build; } diff --git a/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php b/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php index 40fad0b..6d06ed4 100644 --- a/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php +++ b/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php @@ -29,19 +29,19 @@ public function test1() { } public function test2() { - return ['#markup' => "test2"]; + return ['#markup' => "test2", '#cache' => []]; } public function test3($value) { - return ['#markup' => $value]; + return ['#markup' => $value, '#cache' => []]; } public function test4($value) { - return ['#markup' => $value]; + return ['#markup' => $value, '#cache' => []]; } public function test5() { - return ['#markup' => "test5"]; + return ['#markup' => "test5", '#cache' => []]; } public function test6() { diff --git a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php index 3af2ea5..dc8aa54 100644 --- a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php +++ b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php @@ -26,7 +26,7 @@ class SessionTestController extends ControllerBase { public function get() { return empty($_SESSION['session_test_value']) ? [] - : ['#markup' => $this->t('The current value of the stored session variable is: %val', array('%val' => $_SESSION['session_test_value']))]; + : ['#markup' => $this->t('The current value of the stored session variable is: %val', array('%val' => $_SESSION['session_test_value'])), '#cache' => []]; } /** @@ -42,7 +42,7 @@ public function getFromSessionObject(Request $request) { $value = $request->getSession()->get("session_test_key"); return empty($value) ? [] - : ['#markup' => $this->t('The current value of the stored session variable is: %val', array('%val' => $value))]; + : ['#markup' => $this->t('The current value of the stored session variable is: %val', array('%val' => $value)), '#cache' => []]; } /** @@ -61,7 +61,7 @@ public function getId(Request $request) { $request->getSession()->save(); - return ['#markup' => 'session_id:' . session_id() . "\n"]; + return ['#markup' => 'session_id:' . session_id() . "\n", '#cache' => []]; } /** @@ -89,7 +89,7 @@ public function getIdFromCookie(Request $request) { public function set($test_value) { $_SESSION['session_test_value'] = $test_value; - return ['#markup' => $this->t('The current value of the stored session variable has been set to %val', array('%val' => $test_value))]; + return ['#markup' => $this->t('The current value of the stored session variable has been set to %val', array('%val' => $test_value)), '#cache' => []]; } /** @@ -105,7 +105,7 @@ public function set($test_value) { public function noSet($test_value) { \Drupal::service('session_handler.write_safe')->setSessionWritable(FALSE); $this->set($test_value); - return ['#markup' => $this->t('session saving was disabled, and then %val was set', array('%val' => $test_value))]; + return ['#markup' => $this->t('session saving was disabled, and then %val was set', array('%val' => $test_value)), '#cache' => []]; } /** @@ -131,7 +131,7 @@ public function setMessage() { public function setMessageButDontSave() { \Drupal::service('session_handler.write_safe')->setSessionWritable(FALSE); $this->setMessage(); - return ['#markup' => '']; + return ['#markup' => '', '#cache' => []]; } /** @@ -141,7 +141,7 @@ public function setMessageButDontSave() { * A notification message. */ public function isLoggedIn() { - return ['#markup' => $this->t('User is logged in.')]; + return ['#markup' => $this->t('User is logged in.'), '#cache' => []]; } /**