Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/DrupalExtension/Context/VisibilityContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public function iShouldNotSeeTheField($field) {
*
* @param string $element
* Element selector or a string that describes it.
* @param \Behat\Mink\Element\NodeElement $node
* @param \Behat\Mink\Element\NodeElement|null $node
* Node representing the element above, if any.
*
* @throws \Behat\Mink\Exception\ExpectationException
* Throws exception if element not found.
*/
protected function assertElementVisible($element, NodeElement $node) {
protected function assertElementVisible($element, ?NodeElement $node) {
try {
if ($node && !$node->isVisible()) {
throw new ExpectationException(sprintf("The element '%s' is not present on the page %s", $element, $this->getSession()->getCurrentUrl()), $this->getSession());
Expand All @@ -96,13 +96,13 @@ protected function assertElementVisible($element, NodeElement $node) {
*
* @param string $element
* Element selector or a string that describes it.
* @param \Behat\Mink\Element\NodeElement $node
* @param \Behat\Mink\Element\NodeElement|null $node
* Node representing the element above, if any.
*
* @throws \Behat\Mink\Exception\ExpectationException
* Throws exception if element is found.
*/
protected function assertElementNotVisible($element, NodeElement $node) {
protected function assertElementNotVisible($element, ?NodeElement $node) {
try {
if ($node && $node->isVisible()) {
throw new ExpectationException(sprintf("The field '%s' was present on the page %s and was not supposed to be", $element, $this->getSession()->getCurrentUrl()), $this->getSession());
Expand Down