Mercurial > hg > cmmr2012-drupal-site
diff core/modules/quickedit/src/Tests/QuickEditLoadingTest.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php Thu Feb 28 11:14:44 2019 +0000 +++ b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php Thu Feb 28 13:11:55 2019 +0000 @@ -3,7 +3,6 @@ namespace Drupal\quickedit\Tests; use Drupal\Component\Serialization\Json; -use Drupal\Component\Utility\Unicode; use Drupal\block_content\Entity\BlockContent; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; @@ -87,7 +86,7 @@ 0 => [ 'value' => '<p>How are you?</p>', 'format' => 'filtered_html', - ] + ], ], 'revision_log' => $this->randomString(), ]); @@ -188,7 +187,7 @@ 'label' => 'Body', 'access' => TRUE, 'editor' => 'form', - ] + ], ]; $this->assertIdentical(Json::decode($response), $expected, 'The metadata HTTP request answers with the correct JSON response.'); // Restore drupalSettings to build the next requests; simpletest wipes them @@ -216,7 +215,7 @@ $ajax_commands = Json::decode($response); $this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.'); $this->assertIdentical('quickeditFieldForm', $ajax_commands[0]['command'], 'The first AJAX command is a quickeditFieldForm command.'); - $this->assertIdentical('<form ', Unicode::substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); + $this->assertIdentical('<form ', mb_substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); // Prepare form values for submission. drupalPostAjaxForm() is not suitable // for handling pages with JSON responses, so we need our own solution here. @@ -286,7 +285,7 @@ $ajax_commands = Json::decode($response); $this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.'); $this->assertIdentical('quickeditFieldForm', $ajax_commands[0]['command'], 'The first AJAX command is a quickeditFieldForm command.'); - $this->assertIdentical('<form ', Unicode::substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); + $this->assertIdentical('<form ', mb_substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); // Submit field form. preg_match('/\sname="form_token" value="([^"]+)"/', $ajax_commands[0]['data'], $token_match); @@ -374,7 +373,7 @@ 'label' => 'Title', 'access' => TRUE, 'editor' => 'plain_text', - ] + ], ]; $this->assertIdentical(Json::decode($response), $expected, 'The metadata HTTP request answers with the correct JSON response.'); // Restore drupalSettings to build the next requests; simpletest wipes them @@ -389,7 +388,7 @@ $ajax_commands = Json::decode($response); $this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.'); $this->assertIdentical('quickeditFieldForm', $ajax_commands[0]['command'], 'The first AJAX command is a quickeditFieldForm command.'); - $this->assertIdentical('<form ', Unicode::substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); + $this->assertIdentical('<form ', mb_substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); // Prepare form values for submission. drupalPostAjaxForm() is not suitable // for handling pages with JSON responses, so we need our own solution @@ -602,7 +601,7 @@ $response = $this->drupalPost('quickedit/form/node/1/field_image/en/full', '', ['nocssjs' => 'true'] + $this->getAjaxPageStatePostData(), ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']]); $this->assertResponse(200); $ajax_commands = Json::decode($response); - $this->assertIdentical('<form ', Unicode::substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); + $this->assertIdentical('<form ', mb_substr($ajax_commands[0]['data'], 0, 6), 'The quickeditFieldForm command contains a form.'); } }