From e8a1c9ece40f4ed56ddc22a5f297ab04fc426015 Mon Sep 17 00:00:00 2001 From: mmorris Date: Sun, 9 Aug 2015 19:33:27 -0400 Subject: [PATCH] Let the assert stand on it's own. --- .../src/Tests/Bootstrap/DrupalSetMessageTest.php | 3 --- .../src/Controller/SystemTestController.php | 29 ---------------------- 2 files changed, 32 deletions(-) diff --git a/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php b/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php index e54e30a..3b414af 100644 --- a/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php +++ b/core/modules/system/src/Tests/Bootstrap/DrupalSetMessageTest.php @@ -58,9 +58,6 @@ function testDrupalSetMessage() { // Ensure that strings that are not marked as safe are escaped. $this->assertEscaped('Thismarkup will be escaped.'); - - // Ensure the runtime assertion fires on cue. - $this->assertUniqueText('Correct runtime assertion thrown when render array contains #attached.'); } } diff --git a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php index f4a566f..63cd091 100644 --- a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php +++ b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php @@ -144,35 +144,6 @@ public function drupalSetMessageTest() { // Test auto-escape of non safe strings. drupal_set_message('Thismarkup will be escaped.'); - // Test setting messages with a render array containing #attached. - - // @todo Remove this after https://www.drupal.org/node/2536560 is finished. - assert_options(ASSERT_ACTIVE, TRUE); - assert_options(ASSERT_CALLBACK, function($file, $line, $code, $message) { - throw new \Exception($message); - }); - // End block to be removed. - - $array_with_attachments['foo']['bar']['#markup'] = t('Render array with assets'); - $array_with_attachments['foo']['bar']['#attached']['drupalSettings'] = ['pecary' => TRUE]; - - try { - drupal_set_message($array_with_attachments); - } - catch (\Exception $e) { - // @todo Switch to next line when #2536560 is finished. - # catch (\AssertionError $e) { - - // If the exception is the not the one we expect, rethrow causing a test - // failure. - if ($e->getMessage() !== 'Render arrays passed to drupal_set_message() cannot have attachments.') { - throw $e; - } - else { - drupal_set_message('Correct runtime assertion thrown when render array contains #attached.'); - } - } - return []; } -- 1.8.4.2