Skip to content

Commit

Permalink
[BUGFIX] Respect overridden properties in AbstractPageTree (#625)
Browse files Browse the repository at this point in the history
This changes all property accesses within AbstractPageTree to
use static instead of self. Since the class is abstract and
therefore subject to class inheritance, its properties may also
change in subclasses. Using self to access them would hide
potentially overridden properties (late static binding).

Co-authored-by: Elias Häußler <elias@haeussler.dev>
  • Loading branch information
lolli42 and eliashaeussler authored Oct 8, 2024
1 parent 47bf0da commit eb8713d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/Core/Acceptance/Helper/AbstractPageTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function openPath(array $path)
foreach ($path as $pageName) {
$context = $this->ensureTreeNodeIsOpen($pageName, $context);
}
$context->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector(self::$treeItemAnchorSelector))->click();
$context->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector(static::$treeItemAnchorSelector))->click();
}

/**
Expand All @@ -65,7 +65,7 @@ public function getPageTreeElement()
$I = $this->tester;
$I->switchToIFrame();
return $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
return $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector(self::$pageTreeSelector));
return $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector(static::$pageTreeSelector));
});
}

Expand All @@ -79,7 +79,7 @@ public function getPageTreeElement()
protected function ensureTreeNodeIsOpen(string $nodeText, RemoteWebElement $context)
{
$I = $this->tester;
$I->see($nodeText, self::$treeItemSelector);
$I->see($nodeText, static::$treeItemSelector);

/** @var RemoteWebElement $context */
$context = $I->executeInSelenium(function () use (
Expand Down

0 comments on commit eb8713d

Please sign in to comment.