diff --git a/tests/src/Functional/MediaEntityTypePluginTest.php b/tests/src/Functional/MediaEntityTypePluginTest.php index 1f090a5..c1aa3fc 100644 --- a/tests/src/Functional/MediaEntityTypePluginTest.php +++ b/tests/src/Functional/MediaEntityTypePluginTest.php @@ -27,7 +27,7 @@ class MediaEntityTypePluginTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected $defaultTheme = 'stark'; + protected $defaultTheme = 'classy'; /** * {@inheritdoc} diff --git a/tests/src/Functional/UsageTest.php b/tests/src/Functional/UsageTest.php index e4e5477..48527e5 100644 --- a/tests/src/Functional/UsageTest.php +++ b/tests/src/Functional/UsageTest.php @@ -137,8 +137,8 @@ class UsageTest extends BrowserTestBase { $this->drupalGet('admin/config/search/path/add'); // Create alias. - $edit['source'] = '/node/' . $host_node->id(); - $edit['alias'] = '/' . $this->randomMachineName(8); + $edit['path[0][value]'] = '/node/' . $host_node->id(); + $edit['alias[0][value]'] = '/' . $this->randomMachineName(8); $this->drupalPostForm('admin/config/search/path/add', $edit, t('Save')); $this->drupalGet('node/' . $host_node->id() . '/edit'); diff --git a/tests/src/FunctionalJavascript/BynderUploadWidgetTest.php b/tests/src/FunctionalJavascript/BynderUploadWidgetTest.php index c9ea7c2..d19cc3d 100644 --- a/tests/src/FunctionalJavascript/BynderUploadWidgetTest.php +++ b/tests/src/FunctionalJavascript/BynderUploadWidgetTest.php @@ -280,8 +280,8 @@ class BynderUploadWidgetTest extends WebDriverTestBase { $this->drupalGet('admin/config/content/entity_browser/bynder/widgets'); $this->assertSession()->fieldValueEquals('Label (Bynder upload)', 'Upload'); $this->assertSession()->fieldValueEquals('Submit button text', 'Upload assets'); - $this->assertTrue($this->xpath('//select[@name="table[' . $widget_uuid . '][form][media_type]"]//option[@selected="selected" and @value="bynder"]')); - $this->assertTrue($this->xpath('//select[@name="table[' . $widget_uuid . '][form][brand]"]//option[@selected="selected" and @value="brand_id"]')); + $this->assertSession()->elementExists('xpath', '//select[@name="table[' . $widget_uuid . '][form][media_type]"]//option[@selected="selected" and @value="bynder"]'); + $this->assertSession()->elementExists('xpath', '//select[@name="table[' . $widget_uuid . '][form][brand]"]//option[@selected="selected" and @value="brand_id"]'); $this->assertSession()->fieldValueEquals('Allowed file extensions', 'png jpg'); $this->assertSession()->fieldValueEquals('Dropzone drag-n-drop zone text', 'Drop files...'); $this->assertSession()->fieldValueEquals('Tags', 'foo, bar, baz'); diff --git a/tests/src/FunctionalJavascript/ConfigurationFormTest.php b/tests/src/FunctionalJavascript/ConfigurationFormTest.php index 5be97f6..38b72b2 100644 --- a/tests/src/FunctionalJavascript/ConfigurationFormTest.php +++ b/tests/src/FunctionalJavascript/ConfigurationFormTest.php @@ -147,9 +147,9 @@ class ConfigurationFormTest extends WebDriverTestBase { $this->assertSession()->pageTextContains('Select metaproperty option for the assets that may be used only online.'); $this->assertSession()->pageTextContains('Select metaproperty option for the assets that may be used only for print.'); - $this->assertTrue($this->xpath('//select[@name="restrictions[royalty_free]"]//option[@selected="selected" and @value="option1"]')); - $this->assertTrue($this->xpath('//select[@name="restrictions[web_license]"]//option[@selected="selected" and @value="option2"]')); - $this->assertTrue($this->xpath('//select[@name="restrictions[print_license]"]//option[@selected="selected" and @value="option3"]')); + $this->assertSession()->elementExists('xpath', '//select[@name="restrictions[royalty_free]"]//option[@selected="selected" and @value="option1"]'); + $this->assertSession()->elementExists('xpath', '//select[@name="restrictions[web_license]"]//option[@selected="selected" and @value="option2"]'); + $this->assertSession()->elementExists('xpath', '//select[@name="restrictions[print_license]"]//option[@selected="selected" and @value="option3"]'); $this->getSession()->getPage()->selectFieldOption('usage_metaproperty', 'none'); $this->assertSession()->assertWaitOnAjaxRequest(); diff --git a/tests/src/Unit/BynderApiUnitTest.php b/tests/src/Unit/BynderApiUnitTest.php index 0a9277d..cb2cb39 100644 --- a/tests/src/Unit/BynderApiUnitTest.php +++ b/tests/src/Unit/BynderApiUnitTest.php @@ -33,7 +33,7 @@ class BynderApiUnitTest extends UnitTestCase { $cache = $this->prophesize(CacheBackendInterface::class); $time = $this->prophesize(TimeInterface::class); - $api = $this->createMock(BynderApi::class, ['__call'], [$config->reveal(), $logger->reveal(), $session->reveal(), $state->reveal(), $cache->reveal(), $time->reveal()]); + $api = new BynderApi($config->reveal(), $logger->reveal(), $session->reveal(), $state->reveal(), $cache->reveal(), $time->reveal()); $this->assertEquals($expected, $api->hasAccessToken()); }