diff --git a/core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php b/core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php index 4a6d851b4c19a083fe5a2aeacde8664d0be90cb1..dc375371a8e8cfe2264f1ff2990d6f23f982d6b9 100644 --- a/core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php +++ b/core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php @@ -125,7 +125,7 @@ protected function assertCacheTags(array $expected_tags, $include_default_tags = * (optional) Whether the default contexts should automatically be included. * * @return bool - * TRUE if the assertion succeeded, FALSE otherwise. + * Always returns TRUE. */ protected function assertCacheContexts(array $expected_contexts, $message = NULL, $include_default_contexts = TRUE) { if ($include_default_contexts) { @@ -142,7 +142,7 @@ protected function assertCacheContexts(array $expected_contexts, $message = NULL sort($expected_contexts); sort($actual_contexts); $this->assertSame($expected_contexts, $actual_contexts, $message ?? ''); - return $actual_contexts === $expected_contexts; + return TRUE; } /** diff --git a/core/modules/system/tests/src/Functional/Session/SessionTest.php b/core/modules/system/tests/src/Functional/Session/SessionTest.php index acb5321b00a12ed4aa48f293f172fb437efefbde..bd2b924f41f14180ff170ffac763e07a062eba81 100644 --- a/core/modules/system/tests/src/Functional/Session/SessionTest.php +++ b/core/modules/system/tests/src/Functional/Session/SessionTest.php @@ -72,8 +72,7 @@ public function testSessionSaveRegenerate() { $this->drupalGet('user/login'); $this->submitForm($edit, 'Log in'); $this->drupalGet('user'); - $pass = $this->assertSession()->pageTextContains($user->getAccountName()); - $this->_logged_in = $pass; + $this->assertSession()->pageTextContains($user->getAccountName()); $this->drupalGet('session-test/id'); $matches = []; diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php index e6698f74a5a89bcc8d7e1d0da04aca54ac0aea24..5de4c2d8b62d0980f5d54b11997d093e67261bf9 100644 --- a/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php +++ b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php @@ -107,9 +107,6 @@ public function testToolbarCacheContextsCaller() { * Expected cache contexts for both users. * @param string $message * (optional) A verbose message to output. - * - * @return - * TRUE if the assertion succeeded, FALSE otherwise. */ protected function assertToolbarCacheContexts(array $cache_contexts, $message = NULL) { // Default cache contexts that should exist on all test cases. @@ -123,16 +120,13 @@ protected function assertToolbarCacheContexts(array $cache_contexts, $message = // Assert contexts for user1 which has only default permissions. $this->drupalLogin($this->adminUser); $this->drupalGet('test-page'); - $return = $this->assertCacheContexts($cache_contexts); + $this->assertCacheContexts($cache_contexts, $message); $this->drupalLogout(); // Assert contexts for user2 which has some additional permissions. $this->drupalLogin($this->adminUser2); $this->drupalGet('test-page'); - $return = $return && $this->assertCacheContexts($cache_contexts); - - $this->assertTrue($return, $message); - return $return; + $this->assertCacheContexts($cache_contexts, $message); } /** diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php index 7d27e584428dbebc8b545b89adbe99e9eda3ae9c..d8e86e5692f7342a6d5686b461561b0fd4ac3c74 100644 --- a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php @@ -160,9 +160,6 @@ public function testPagePaths() { * * @param string $path * Path that will be set as the view page display path. - * - * @return bool - * Assertion result. */ public function assertPagePath($path) { $view = Views::getView('test_page_display_path'); @@ -172,10 +169,10 @@ public function assertPagePath($path) { $this->container->get('router.builder')->rebuild(); // Check if we successfully changed the path. $this->drupalGet($path); - $success = $this->assertSession()->statusCodeEquals(200); + $this->assertSession()->statusCodeEquals(200); // Check if we don't get any error on the view edit page. $this->drupalGet('admin/structure/views/view/test_page_display_path'); - return $success && $this->assertSession()->statusCodeEquals(200); + $this->assertSession()->statusCodeEquals(200); } }