Loading core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\layout_builder\FunctionalJavascript; use Behat\Mink\Element\NodeElement; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay; use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait; Loading Loading @@ -236,7 +237,7 @@ protected function moveBlockWithKeyboard($direction, $block_label, array $update * @return \Behat\Mink\Element\NodeElement * The row handle element. */ protected function findRowHandle($block_label) { protected function findRowHandle($block_label): NodeElement { $assert_session = $this->assertSession(); return $assert_session->elementExists('css', "[data-drupal-selector=\"edit-components\"] td:contains(\"$block_label\") a.tabledrag-handle"); } Loading core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php +5 −4 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\media_library\FunctionalJavascript; use Behat\Mink\Element\NodeElement; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\media\Entity\Media; Loading Loading @@ -154,7 +155,7 @@ protected function waitForElementTextContains($selector, $text, $timeout = 10000 * @todo replace with whatever gets added in * https://www.drupal.org/node/3061852 */ protected function assertElementExistsAfterWait($selector, $locator, $timeout = 10000) { protected function assertElementExistsAfterWait($selector, $locator, $timeout = 10000): NodeElement { $element = $this->assertSession()->waitForElement($selector, $locator, $timeout); $this->assertNotEmpty($element); return $element; Loading @@ -166,7 +167,7 @@ protected function assertElementExistsAfterWait($selector, $locator, $timeout = * @return \Behat\Mink\Element\NodeElement * The menu of available media types. */ protected function getTypesMenu() { protected function getTypesMenu(): NodeElement { return $this->assertSession() ->elementExists('css', '.js-media-library-menu'); } Loading Loading @@ -275,7 +276,7 @@ protected function pressSaveButton($expect_errors = FALSE) { * @return \Behat\Mink\Element\NodeElement * The NodeElement found via $after_open_selector. */ protected function openMediaLibraryForField($field_name, $after_open_selector = '.js-media-library-menu') { protected function openMediaLibraryForField($field_name, $after_open_selector = '.js-media-library-menu'): NodeElement { $this->assertElementExistsAfterWait('css', "#$field_name-media-library-wrapper.js-media-library-widget") ->pressButton('Add media'); $this->waitForText('Add or select media'); Loading @@ -302,7 +303,7 @@ protected function openMediaLibraryForField($field_name, $after_open_selector = * @return \Behat\Mink\Element\NodeElement * The "additional selected media" area. */ protected function getSelectionArea($open = TRUE) { protected function getSelectionArea($open = TRUE): NodeElement { $summary = $this->assertElementExistsAfterWait('css', 'summary:contains("Additional selected media")'); if ($open) { $summary->click(); Loading core/modules/update/tests/src/Functional/UpdateTestBase.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\update\Functional; use Behat\Mink\Element\NodeElement; use Drupal\Core\Url; use Drupal\Tests\BrowserTestBase; Loading Loading @@ -294,7 +295,7 @@ protected function assertUpdateTableElementNotContains($text) { * @return \Behat\Mink\Element\NodeElement * The update element. */ protected function findUpdateElementByLabel($label, int $index = 0) { protected function findUpdateElementByLabel($label, int $index = 0): NodeElement { $update_elements = $this->getSession()->getPage() ->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"$label\")"); $this->assertGreaterThanOrEqual($index, count($update_elements)); Loading core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -556,7 +556,7 @@ protected function assertTableRow(NodeElement $row, string $id, int $weight, str * @return \Behat\Mink\Element\NodeElement * The row element. */ protected function findRowById($id, $table_id = 'tabledrag-test-table') { protected function findRowById($id, $table_id = 'tabledrag-test-table'): NodeElement { $xpath = "//table[@id='$table_id']/tbody/tr[.//input[@name='table[$id][id]']]"; $row = $this->getSession()->getPage()->find('xpath', $xpath); $this->assertNotEmpty($row); Loading @@ -572,7 +572,7 @@ protected function findRowById($id, $table_id = 'tabledrag-test-table') { * @return \Behat\Mink\Element\NodeElement * The toggle element. */ protected function findWeightsToggle($expected_text) { protected function findWeightsToggle($expected_text): NodeElement { $toggle = $this->getSession()->getPage()->findButton($expected_text); $this->assertNotEmpty($toggle); return $toggle; Loading Loading
core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\layout_builder\FunctionalJavascript; use Behat\Mink\Element\NodeElement; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay; use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait; Loading Loading @@ -236,7 +237,7 @@ protected function moveBlockWithKeyboard($direction, $block_label, array $update * @return \Behat\Mink\Element\NodeElement * The row handle element. */ protected function findRowHandle($block_label) { protected function findRowHandle($block_label): NodeElement { $assert_session = $this->assertSession(); return $assert_session->elementExists('css', "[data-drupal-selector=\"edit-components\"] td:contains(\"$block_label\") a.tabledrag-handle"); } Loading
core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php +5 −4 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\media_library\FunctionalJavascript; use Behat\Mink\Element\NodeElement; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\media\Entity\Media; Loading Loading @@ -154,7 +155,7 @@ protected function waitForElementTextContains($selector, $text, $timeout = 10000 * @todo replace with whatever gets added in * https://www.drupal.org/node/3061852 */ protected function assertElementExistsAfterWait($selector, $locator, $timeout = 10000) { protected function assertElementExistsAfterWait($selector, $locator, $timeout = 10000): NodeElement { $element = $this->assertSession()->waitForElement($selector, $locator, $timeout); $this->assertNotEmpty($element); return $element; Loading @@ -166,7 +167,7 @@ protected function assertElementExistsAfterWait($selector, $locator, $timeout = * @return \Behat\Mink\Element\NodeElement * The menu of available media types. */ protected function getTypesMenu() { protected function getTypesMenu(): NodeElement { return $this->assertSession() ->elementExists('css', '.js-media-library-menu'); } Loading Loading @@ -275,7 +276,7 @@ protected function pressSaveButton($expect_errors = FALSE) { * @return \Behat\Mink\Element\NodeElement * The NodeElement found via $after_open_selector. */ protected function openMediaLibraryForField($field_name, $after_open_selector = '.js-media-library-menu') { protected function openMediaLibraryForField($field_name, $after_open_selector = '.js-media-library-menu'): NodeElement { $this->assertElementExistsAfterWait('css', "#$field_name-media-library-wrapper.js-media-library-widget") ->pressButton('Add media'); $this->waitForText('Add or select media'); Loading @@ -302,7 +303,7 @@ protected function openMediaLibraryForField($field_name, $after_open_selector = * @return \Behat\Mink\Element\NodeElement * The "additional selected media" area. */ protected function getSelectionArea($open = TRUE) { protected function getSelectionArea($open = TRUE): NodeElement { $summary = $this->assertElementExistsAfterWait('css', 'summary:contains("Additional selected media")'); if ($open) { $summary->click(); Loading
core/modules/update/tests/src/Functional/UpdateTestBase.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\update\Functional; use Behat\Mink\Element\NodeElement; use Drupal\Core\Url; use Drupal\Tests\BrowserTestBase; Loading Loading @@ -294,7 +295,7 @@ protected function assertUpdateTableElementNotContains($text) { * @return \Behat\Mink\Element\NodeElement * The update element. */ protected function findUpdateElementByLabel($label, int $index = 0) { protected function findUpdateElementByLabel($label, int $index = 0): NodeElement { $update_elements = $this->getSession()->getPage() ->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"$label\")"); $this->assertGreaterThanOrEqual($index, count($update_elements)); Loading
core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -556,7 +556,7 @@ protected function assertTableRow(NodeElement $row, string $id, int $weight, str * @return \Behat\Mink\Element\NodeElement * The row element. */ protected function findRowById($id, $table_id = 'tabledrag-test-table') { protected function findRowById($id, $table_id = 'tabledrag-test-table'): NodeElement { $xpath = "//table[@id='$table_id']/tbody/tr[.//input[@name='table[$id][id]']]"; $row = $this->getSession()->getPage()->find('xpath', $xpath); $this->assertNotEmpty($row); Loading @@ -572,7 +572,7 @@ protected function findRowById($id, $table_id = 'tabledrag-test-table') { * @return \Behat\Mink\Element\NodeElement * The toggle element. */ protected function findWeightsToggle($expected_text) { protected function findWeightsToggle($expected_text): NodeElement { $toggle = $this->getSession()->getPage()->findButton($expected_text); $this->assertNotEmpty($toggle); return $toggle; Loading