diff --git a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php index a4cbacdf9e65c00077fc5a1ebbbc036c0f78bd53..ba69bfee603f41c0dfe5560eed570c06e9696a5b 100644 --- a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php +++ b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php @@ -101,8 +101,8 @@ public function attachmentsProvider() { 'random attachment type (unofficial), with random assigned value, to prove BigPipeResponseAttachmentsProcessor is a perfect decorator' => [$random_attachments], ]; - $big_pipe_placeholder_attachments = ['big_pipe_placeholders' => $this->randomMachineName()]; - $big_pipe_nojs_placeholder_attachments = ['big_pipe_nojs_placeholders' => $this->randomMachineName()]; + $big_pipe_placeholder_attachments = ['big_pipe_placeholders' => [$this->randomMachineName()]]; + $big_pipe_nojs_placeholder_attachments = ['big_pipe_nojs_placeholders' => [$this->randomMachineName()]]; $big_pipe_cases = [ 'only big_pipe_placeholders' => [$big_pipe_placeholder_attachments], 'only big_pipe_nojs_placeholders' => [$big_pipe_nojs_placeholder_attachments], diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php index dff62702459433fd79d265e326675e31ffe0bd4b..9ccbb135d2f2804764d745bb3f768af4425fb5a5 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php @@ -77,7 +77,7 @@ public function testMapperListPage() { // Make sure there is only a single operation for each dropbutton, either // 'List' or 'Translate'. foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) { - $this->assertIdentical(1, count($dropbutton->find('xpath', 'li'))); + $this->assertIdentical(1, count($dropbutton->findAll('xpath', 'li'))); $this->assertTrue(($dropbutton->getText() === 'Translate') || ($dropbutton->getText() === 'List')); } @@ -103,7 +103,7 @@ public function testMapperListPage() { // Make sure there is only a single 'Translate' operation for each // dropbutton. foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) { - $this->assertIdentical(1, count($dropbutton->find('xpath', 'li'))); + $this->assertIdentical(1, count($dropbutton->findAll('xpath', 'li'))); $this->assertIdentical('Translate', $dropbutton->getText()); } diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php index fa68cb61509fe71a40052aacbdf779b18e0f80f4..f640796fb2b863fc442d81ff55d5051566c5f0a8 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php @@ -330,6 +330,12 @@ public function testFieldAdminHandler() { $this->drupalPostForm(NULL, $edit, t('Save field settings')); $this->drupalGet($bundle_path . '/fields/' . $field_path); $term_name = $this->randomString(); + $result = \Drupal::entityQuery('taxonomy_term') + ->condition('name', $term_name) + ->condition('vid', 'tags') + ->accessCheck(FALSE) + ->execute(); + $this->assertIdentical(0, count($result), "No taxonomy terms exist with the name '$term_name'."); $edit = [ // This must be set before new entities will be auto-created. 'settings[handler_settings][auto_create]' => 1, @@ -342,8 +348,12 @@ public function testFieldAdminHandler() { ]; $this->drupalPostForm(NULL, $edit, t('Save settings')); // The term should now exist. - $term = taxonomy_term_load_multiple_by_name($term_name, 'tags')[1]; - $this->assertIdentical(1, count($term), 'Taxonomy term was auto created when set as field default.'); + $result = \Drupal::entityQuery('taxonomy_term') + ->condition('name', $term_name) + ->condition('vid', 'tags') + ->accessCheck(FALSE) + ->execute(); + $this->assertIdentical(1, count($result), 'Taxonomy term was auto created when set as field default.'); } /** diff --git a/core/modules/tour/tests/src/Functional/TourTestBase.php b/core/modules/tour/tests/src/Functional/TourTestBase.php index 522e8e6f36484af66523002560f2f30c53a6fd1d..a8487def61ee618a222354927ffff04546684b42 100644 --- a/core/modules/tour/tests/src/Functional/TourTestBase.php +++ b/core/modules/tour/tests/src/Functional/TourTestBase.php @@ -50,14 +50,13 @@ public function assertTourTips($tips = []) { // Check for corresponding page elements. $total = 0; $modals = 0; - $raw_content = $this->getSession()->getPage()->getContent(); foreach ($tips as $tip) { if (!empty($tip['data-id'])) { - $elements = \PHPUnit_Util_XML::cssSelect('#' . $tip['data-id'], TRUE, $raw_content, TRUE); + $elements = $this->getSession()->getPage()->findAll('css', '#' . $tip['data-id']); $this->assertTrue(!empty($elements) && count($elements) === 1, format_string('Found corresponding page element for tour tip with id #%data-id', ['%data-id' => $tip['data-id']])); } elseif (!empty($tip['data-class'])) { - $elements = \PHPUnit_Util_XML::cssSelect('.' . $tip['data-class'], TRUE, $raw_content, TRUE); + $elements = $this->getSession()->getPage()->findAll('css', '.' . $tip['data-class']); $this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', ['%data-class' => $tip['data-class']])); } else {