From 2f1345a9ec651f68c455861327955308db34b6d2 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 18 Feb 2015 12:39:20 +0000 Subject: [PATCH] Issue #2421699 by JeroenT: Remove usage of deprecated functions of WebTestBase --- .../block/src/Tests/BlockRenderOrderTest.php | 2 +- .../comment/src/Tests/CommentBlockTest.php | 4 ++-- .../comment/src/Tests/CommentNonNodeTest.php | 6 +++--- .../comment/src/Tests/CommentTestBase.php | 6 +++--- .../src/Tests/ConfigExportImportUITest.php | 4 ++-- .../config/src/Tests/ConfigExportUITest.php | 2 +- .../ContentTranslationContextualLinksTest.php | 2 +- .../datetime/src/Tests/DateTimeFieldTest.php | 2 +- .../modules/editor/src/Tests/EditorAdminTest.php | 6 +++--- .../field/src/Tests/Boolean/BooleanFieldTest.php | 2 +- .../field/src/Tests/Email/EmailFieldTest.php | 2 +- .../field/src/Tests/String/StringFieldTest.php | 2 +- .../field_ui/src/Tests/ManageDisplayTest.php | 6 +++--- core/modules/file/src/Tests/FileListingTest.php | 2 +- .../src/Tests/Views/HistoryTimestampTest.php | 2 +- .../image/src/Tests/ImageThemeFunctionTest.php | 16 ++++++++-------- core/modules/link/src/Tests/LinkFieldTest.php | 2 +- .../modules/node/src/Tests/SummaryLengthTest.php | 4 ++-- .../src/Tests/Views/NodeContextualLinksTest.php | 2 +- .../src/Tests/QuickEditAutocompleteTermTest.php | 4 ++-- .../modules/simpletest/src/Tests/BrowserTest.php | 2 +- .../modules/system/src/Tests/Ajax/DialogTest.php | 4 ++-- .../system/src/Tests/Bootstrap/PageCacheTest.php | 6 +++--- .../system/src/Tests/Common/AddFeedTest.php | 2 +- .../system/src/Tests/Common/RenderWebTest.php | 4 ++-- .../Tests/Database/SelectPagerDefaultTest.php | 4 ++-- .../Database/SelectTableSortDefaultTest.php | 4 ++-- .../src/Tests/Database/TemporaryQueryTest.php | 2 +- core/modules/system/src/Tests/Form/FormTest.php | 2 +- .../src/Tests/Form/LanguageSelectElementTest.php | 2 +- .../system/src/Tests/Session/SessionTest.php | 4 ++-- .../src/Tests/System/ShutdownFunctionsTest.php | 2 +- .../system/src/Tests/Theme/EngineTwigTest.php | 2 +- .../Tests/Theme/ThemeSuggestionsAlterTest.php | 2 +- .../system/src/Tests/Theme/TwigFilterTest.php | 2 +- .../system/src/Tests/Theme/TwigNamespaceTest.php | 2 +- .../system/src/Tests/Theme/TwigRawTest.php | 2 +- .../Tests/TermFieldMultipleVocabularyTest.php | 4 ++-- .../modules/taxonomy/src/Tests/TermFieldTest.php | 2 +- core/modules/text/src/Tests/TextFieldTest.php | 4 ++-- .../update/src/Tests/UpdateContribTest.php | 2 +- core/modules/user/src/Tests/UserBlocksTest.php | 4 ++-- .../views/src/Tests/Plugin/DisplayTest.php | 8 ++++---- .../views/src/Tests/Plugin/ExposedFormTest.php | 2 +- .../views/src/Tests/Plugin/StyleGridTest.php | 2 +- core/modules/views/src/Tests/ViewAjaxTest.php | 2 +- core/modules/views/src/Tests/ViewElementTest.php | 8 ++++---- .../views/src/Tests/Wizard/ItemsPerPageTest.php | 4 ++-- .../views/src/Tests/Wizard/SortingTest.php | 4 ++-- 49 files changed, 86 insertions(+), 86 deletions(-) diff --git a/core/modules/block/src/Tests/BlockRenderOrderTest.php b/core/modules/block/src/Tests/BlockRenderOrderTest.php index 11da1919e8e1..45bcf540b685 100644 --- a/core/modules/block/src/Tests/BlockRenderOrderTest.php +++ b/core/modules/block/src/Tests/BlockRenderOrderTest.php @@ -68,7 +68,7 @@ class BlockRenderOrderTest extends WebTestBase { } $this->drupalGet(''); - $test_content = $this->drupalGetContent(''); + $test_content = $this->getRawContent(''); $controller = $this->container->get('entity.manager')->getStorage('block'); foreach ($controller->loadMultiple() as $return_block) { diff --git a/core/modules/comment/src/Tests/CommentBlockTest.php b/core/modules/comment/src/Tests/CommentBlockTest.php index d93a220aa39b..a7bcc945b13c 100644 --- a/core/modules/comment/src/Tests/CommentBlockTest.php +++ b/core/modules/comment/src/Tests/CommentBlockTest.php @@ -74,10 +74,10 @@ class CommentBlockTest extends CommentTestBase { $this->assertText($comments[$i]->getSubject(), String::format('Comment @number found in block.', array('@number' => 10 - $i))); if ($i > 1) { $previous_position = $position; - $position = strpos($this->drupalGetContent(), $comments[$i]->getSubject()); + $position = strpos($this->getRawContent(), $comments[$i]->getSubject()); $this->assertTrue($position > $previous_position, String::format('Comment @a appears after comment @b', array('@a' => 10 - $i, '@b' => 11 - $i))); } - $position = strpos($this->drupalGetContent(), $comments[$i]->getSubject()); + $position = strpos($this->getRawContent(), $comments[$i]->getSubject()); } // Test that links to comments work when comments are across pages. diff --git a/core/modules/comment/src/Tests/CommentNonNodeTest.php b/core/modules/comment/src/Tests/CommentNonNodeTest.php index 97dd9ccb6c8b..b4fabee2e55e 100644 --- a/core/modules/comment/src/Tests/CommentNonNodeTest.php +++ b/core/modules/comment/src/Tests/CommentNonNodeTest.php @@ -186,7 +186,7 @@ class CommentNonNodeTest extends WebTestBase { $regex .= $comment->comment_body->value . '(.*?)'; $regex .= '/s'; - return (boolean) preg_match($regex, $this->drupalGetContent()); + return (boolean) preg_match($regex, $this->getRawContent()); } else { return FALSE; @@ -200,7 +200,7 @@ class CommentNonNodeTest extends WebTestBase { * Contact info is available. */ function commentContactInfoAvailable() { - return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->drupalGetContent()); + return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->getRawContent()); } /** @@ -239,7 +239,7 @@ class CommentNonNodeTest extends WebTestBase { */ function getUnapprovedComment($subject) { $this->drupalGet('admin/content/comment/approval'); - preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->drupalGetContent(), $match); + preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->getRawContent(), $match); return $match[2]; } diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php index 7b1f7e00e776..dbb6d560967d 100644 --- a/core/modules/comment/src/Tests/CommentTestBase.php +++ b/core/modules/comment/src/Tests/CommentTestBase.php @@ -193,7 +193,7 @@ abstract class CommentTestBase extends WebTestBase { $regex .= ($reply ? '\s(.*?)' : ''); $regex .= '!s'; - return (boolean) preg_match($regex, $this->drupalGetContent()); + return (boolean) preg_match($regex, $this->getRawContent()); } else { return FALSE; @@ -326,7 +326,7 @@ abstract class CommentTestBase extends WebTestBase { * Contact info is available. */ function commentContactInfoAvailable() { - return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->drupalGetContent()); + return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->getRawContent()); } /** @@ -365,7 +365,7 @@ abstract class CommentTestBase extends WebTestBase { */ function getUnapprovedComment($subject) { $this->drupalGet('admin/content/comment/approval'); - preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->drupalGetContent(), $match); + preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->getRawContent(), $match); return $match[2]; } diff --git a/core/modules/config/src/Tests/ConfigExportImportUITest.php b/core/modules/config/src/Tests/ConfigExportImportUITest.php index f3aa1ff1ab68..5f8e5ba86b86 100644 --- a/core/modules/config/src/Tests/ConfigExportImportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php @@ -127,7 +127,7 @@ class ConfigExportImportUITest extends WebTestBase { // Export the configuration. $this->drupalPostForm('admin/config/development/configuration/full/export', array(), 'Export'); - $this->tarball = $this->drupalGetContent(); + $this->tarball = $this->getRawContent(); $this->config('system.site') ->set('slogan', $this->originalSlogan) @@ -184,7 +184,7 @@ class ConfigExportImportUITest extends WebTestBase { // Export the configuration. $this->drupalPostForm('admin/config/development/configuration/full/export', array(), 'Export'); - $this->tarball = $this->drupalGetContent(); + $this->tarball = $this->getRawContent(); $filename = file_directory_temp() .'/' . $this->randomMachineName(); file_put_contents($filename, $this->tarball); diff --git a/core/modules/config/src/Tests/ConfigExportUITest.php b/core/modules/config/src/Tests/ConfigExportUITest.php index fe3ae8d24840..1a679de644d2 100644 --- a/core/modules/config/src/Tests/ConfigExportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportUITest.php @@ -47,7 +47,7 @@ class ConfigExportUITest extends WebTestBase { $this->assertResponse(200, 'User can access the download callback.'); // Get the archived binary file provided to user for download. - $archive_data = $this->drupalGetContent(); + $archive_data = $this->getRawContent(); // Temporarily save the archive file. $uri = file_unmanaged_save_data($archive_data, 'temporary://config.tar.gz'); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php index 0dd98bf60d55..196fa258a202 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php @@ -131,7 +131,7 @@ class ContentTranslationContextualLinksTest extends WebTestBase { $response = $this->renderContextualLinks(array('node:node=1:'), 'node/' . $node->id()); $this->assertResponse(200); $json = Json::decode($response); - $this->drupalSetContent($json['node:node=1:']); + $this->setRawContent($json['node:node=1:']); $this->assertLinkByHref($translate_link, 0, 'The contextual link to translate the node is shown.'); // Check that the link leads to the translate page. diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php index 1f3a409d89d9..e2223dc016c7 100644 --- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php +++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php @@ -491,7 +491,7 @@ class DateTimeFieldTest extends WebTestBase { $display = EntityViewDisplay::collectRenderDisplay($entity, $view_mode); $build = $display->build($entity); $output = drupal_render($build); - $this->drupalSetContent($output); + $this->setRawContent($output); $this->verbose($output); } diff --git a/core/modules/editor/src/Tests/EditorAdminTest.php b/core/modules/editor/src/Tests/EditorAdminTest.php index b151896bf1de..7ffa1222c2fb 100644 --- a/core/modules/editor/src/Tests/EditorAdminTest.php +++ b/core/modules/editor/src/Tests/EditorAdminTest.php @@ -54,9 +54,9 @@ class EditorAdminTest extends WebTestBase { $this->drupalGet('admin/config/content/formats/manage/filtered_html'); // Ensure the form field order is correct. - $roles_pos = strpos($this->drupalGetContent(), 'Roles'); - $editor_pos = strpos($this->drupalGetContent(), 'Text editor'); - $filters_pos = strpos($this->drupalGetContent(), 'Enabled filters'); + $roles_pos = strpos($this->getRawContent(), 'Roles'); + $editor_pos = strpos($this->getRawContent(), 'Text editor'); + $filters_pos = strpos($this->getRawContent(), 'Enabled filters'); $this->assertTrue($roles_pos < $editor_pos && $editor_pos < $filters_pos, '"Text Editor" select appears in the correct location of the text format configuration UI.'); // Verify the