diff --git a/PHPUnit/Extensions/Selenium2TestCase/CommandsHolder.php b/PHPUnit/Extensions/Selenium2TestCase/CommandsHolder.php index 6e0cd363..3c4d4344 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/CommandsHolder.php +++ b/PHPUnit/Extensions/Selenium2TestCase/CommandsHolder.php @@ -98,8 +98,9 @@ private function checkArguments(array $arguments): void /** * @param string $commandName The called method name defined as a key in initCommands() + * @param string|array|null $jsonParameters */ - protected function newCommand(string $commandName, array $jsonParameters): Command + protected function newCommand(string $commandName, $jsonParameters): Command { if (isset($this->commands[$commandName])) { $factoryMethod = $this->commands[$commandName]; diff --git a/PHPUnit/Extensions/Selenium2TestCase/ElementCommand/Rect.php b/PHPUnit/Extensions/Selenium2TestCase/ElementCommand/Rect.php index faa20ccb..bf53d448 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/ElementCommand/Rect.php +++ b/PHPUnit/Extensions/Selenium2TestCase/ElementCommand/Rect.php @@ -18,9 +18,10 @@ */ class Rect extends Command { - public function __construct(string $parameter, URL $attributeResourceBaseUrl) + /** @param null $parameter */ + public function __construct($parameter, URL $attributeResourceBaseUrl) { - parent::__construct([], $attributeResourceBaseUrl->descend($parameter)); + parent::__construct([], $attributeResourceBaseUrl); } public function httpMethod(): string diff --git a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Frame.php b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Frame.php index 447071da..00afd74e 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Frame.php +++ b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Frame.php @@ -12,6 +12,7 @@ use PHPUnit\Extensions\Selenium2TestCase\Command; use PHPUnit\Extensions\Selenium2TestCase\Element; +use PHPUnit\Extensions\Selenium2TestCase\URL; /** * Changes the focus to a frame. diff --git a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Location.php b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Location.php index 5df1daf4..e5c20cf9 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Location.php +++ b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Location.php @@ -10,6 +10,8 @@ namespace PHPUnit\Extensions\Selenium2TestCase\SessionCommand; +use PHPUnit\Extensions\Selenium2TestCase\URL; + /** * Gets or posts an attribute from/to the session (title, alert text, etc.) */ diff --git a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Log.php b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Log.php index 8c5da29e..8399b409 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Log.php +++ b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Log.php @@ -11,6 +11,7 @@ namespace PHPUnit\Extensions\Selenium2TestCase\SessionCommand; use PHPUnit\Extensions\Selenium2TestCase\Command; +use PHPUnit\Extensions\Selenium2TestCase\URL; /** * Get the log for a given log type. Log buffer is reset after each request. diff --git a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Orientation.php b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Orientation.php index 342180b5..94d30ff5 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Orientation.php +++ b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Orientation.php @@ -10,6 +10,8 @@ namespace PHPUnit\Extensions\Selenium2TestCase\SessionCommand; +use PHPUnit\Extensions\Selenium2TestCase\URL; + /** * Gets or posts an attribute from/to the session (title, alert text, etc.) */ diff --git a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Url.php b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Url.php index d37e2601..0f8020ef 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Url.php +++ b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Url.php @@ -18,7 +18,7 @@ */ class Url extends Command { - public function __construct(?string $url, URL $commandUrl, SeleniumURL $baseUrl) + public function __construct(?string $url, SeleniumURL $commandUrl, SeleniumURL $baseUrl) { if ($url !== null) { $absoluteLocation = $baseUrl->jump($url)->getValue(); diff --git a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Window.php b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Window.php index 6c10de6b..1b50c283 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Window.php +++ b/PHPUnit/Extensions/Selenium2TestCase/SessionCommand/Window.php @@ -11,6 +11,7 @@ namespace PHPUnit\Extensions\Selenium2TestCase\SessionCommand; use PHPUnit\Extensions\Selenium2TestCase\Command; +use PHPUnit\Extensions\Selenium2TestCase\URL; /** * Changes the focus to a window. diff --git a/PHPUnit/Extensions/Selenium2TestCase/URL.php b/PHPUnit/Extensions/Selenium2TestCase/URL.php index f8e68027..405afc96 100644 --- a/PHPUnit/Extensions/Selenium2TestCase/URL.php +++ b/PHPUnit/Extensions/Selenium2TestCase/URL.php @@ -44,7 +44,7 @@ public function __toString() return $this->getValue(); } - public function descend(string $addition): URL + public function descend(?string $addition): URL { if ($addition === '') { // if we're adding nothing, respect the current url's choice of diff --git a/Tests/Selenium2TestCase/WaitUntilTest.php b/Tests/Selenium2TestCase/WaitUntilTest.php index 617aa015..ee31746b 100644 --- a/Tests/Selenium2TestCase/WaitUntilTest.php +++ b/Tests/Selenium2TestCase/WaitUntilTest.php @@ -86,13 +86,6 @@ public function testWaitUnsuccessfully() }, 42); } - public function testInvalidCallback() - { - $this->expectException(\PHPUnit\Extensions\Selenium2TestCase\Exception::class); - $this->expectExceptionMessage('The valid callback is expected'); - $this->waitUntil('not a callback'); - } - public function testImplicitWaitIsRestoredAfterFailure() { $this->url('html/test_wait.html');