Skip to content

Commit ada10c5

Browse files
committed
Change PSR0 PHPUnit_Extensions_Selenium2TestCase_Exception to PSR4 \PHPUnit\Extensions\Selenium2TestCase\Exception
1 parent 1d26921 commit ada10c5

File tree

13 files changed

+21
-20
lines changed

13 files changed

+21
-20
lines changed

PHPUnit/Extensions/Selenium2TestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
use PHPUnit\Framework\TestCase;
5252
use PHPUnit\Framework\TestResult;
5353
use PHPUnit\Util\InvalidArgumentHelper;
54-
use PHPUnit_Extensions_Selenium2TestCase_Exception;
5554
use PHPUnit_Extensions_Selenium2TestCase_KeysHolder;
5655
use PHPUnit_Extensions_Selenium2TestCase_NoSeleniumException;
5756
use PHPUnit_Extensions_Selenium2TestCase_Session;
@@ -432,7 +431,7 @@ public function onNotSuccessfulTest(Throwable $e): void
432431
public function __call($command, $arguments)
433432
{
434433
if ($this->session === NULL) {
435-
throw new PHPUnit_Extensions_Selenium2TestCase_Exception("There is currently no active session to execute the '$command' command. You're probably trying to set some option in setUp() with an incorrect setter name. You may consider using setUpPage() instead.");
434+
throw new \PHPUnit\Extensions\Selenium2TestCase\Exception("There is currently no active session to execute the '$command' command. You're probably trying to set some option in setUp() with an incorrect setter name. You may consider using setUpPage() instead.");
436435
}
437436
$result = call_user_func_array(
438437
array($this->session, $command), $arguments
@@ -600,7 +599,7 @@ public function waitUntil($callback, $timeout = NULL)
600599
* Deprecated due to issues with IE webdriver. Use keys() method instead
601600
* @deprecated
602601
* @param string $name
603-
* @throws PHPUnit_Extensions_Selenium2TestCase_Exception
602+
* @throws \PHPUnit\Extensions\Selenium2TestCase\Exception
604603
* @see PHPUnit_Extensions_Selenium2TestCase_KeysHolder
605604
*/
606605
public function keysSpecial($name)

PHPUnit/Extensions/Selenium2TestCase/Driver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
namespace PHPUnit\Extensions\Selenium2TestCase;
4646

4747
use BadMethodCallException;
48-
use PHPUnit_Extensions_Selenium2TestCase_Exception;
4948
use PHPUnit_Extensions_Selenium2TestCase_NoSeleniumException;
5049
use PHPUnit_Extensions_Selenium2TestCase_Response;
5150
use PHPUnit_Extensions_Selenium2TestCase_Session;
@@ -150,7 +149,7 @@ public function curl($http_method,
150149
$content = json_decode($rawResponse, TRUE);
151150

152151
if ($content === null && json_last_error() !== JSON_ERROR_NONE) {
153-
throw new PHPUnit_Extensions_Selenium2TestCase_Exception(
152+
throw new \PHPUnit\Extensions\Selenium2TestCase\Exception(
154153
sprintf(
155154
"JSON decoding of remote response failed.\n".
156155
"Error code: %d\n".

PHPUnit/Extensions/Selenium2TestCase/Exception.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
* @since File available since Release 1.2.6
4343
*/
4444

45+
namespace PHPUnit\Extensions\Selenium2TestCase;
46+
47+
use RuntimeException;
48+
4549
/**
4650
* Indicates an exception during the execution of Selenium 2 commands.
4751
*
@@ -53,6 +57,6 @@
5357
* @link http://www.phpunit.de/
5458
* @since Class available since Release 1.2.6
5559
*/
56-
class PHPUnit_Extensions_Selenium2TestCase_Exception extends RuntimeException
60+
class Exception extends RuntimeException
5761
{
5862
}

PHPUnit/Extensions/Selenium2TestCase/KeysHolder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function specialKey($name)
119119
$normalizedName = strtolower($name);
120120

121121
if (!isset($this->_keys[$normalizedName])) {
122-
throw new PHPUnit_Extensions_Selenium2TestCase_Exception("There is no special key '$name' defined");
122+
throw new \PHPUnit\Extensions\Selenium2TestCase\Exception("There is no special key '$name' defined");
123123
}
124124

125125
return $this->_keys[$normalizedName];

PHPUnit/Extensions/Selenium2TestCase/NoSeleniumException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
* @link http://www.phpunit.de/
5252
* @since Class available since Release 1.2.8
5353
*/
54-
class PHPUnit_Extensions_Selenium2TestCase_NoSeleniumException
55-
extends PHPUnit_Extensions_Selenium2TestCase_Exception
54+
class PHPUnit_Extensions_Selenium2TestCase_NoSeleniumException extends \PHPUnit\Extensions\Selenium2TestCase\Exception
5655
{
5756
}

PHPUnit/Extensions/Selenium2TestCase/Session/Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function get($name)
8989
return $cookie['value'];
9090
}
9191
}
92-
throw new PHPUnit_Extensions_Selenium2TestCase_Exception("There is no '$name' cookie available on this page.");
92+
throw new \PHPUnit\Extensions\Selenium2TestCase\Exception("There is no '$name' cookie available on this page.");
9393
}
9494

9595
/**

PHPUnit/Extensions/Selenium2TestCase/Session/Timeouts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function getLastImplicitWaitValue()
102102
public function check($timeout)
103103
{
104104
if ($timeout > $this->maximumTimeout) {
105-
throw new PHPUnit_Extensions_Selenium2TestCase_Exception('There is no use in setting this timeout unless you also call $this->setSeleniumServerRequestsTimeout($seconds) in setUp().');
105+
throw new \PHPUnit\Extensions\Selenium2TestCase\Exception('There is no use in setting this timeout unless you also call $this->setSeleniumServerRequestsTimeout($seconds) in setUp().');
106106
}
107107
}
108108
}

PHPUnit/Extensions/Selenium2TestCase/SessionCommand/MoveTo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __construct($element,
7777

7878
if (isset($jsonParameters['element'])) {
7979
if (!($jsonParameters['element'] instanceof Element)) {
80-
throw new PHPUnit_Extensions_Selenium2TestCase_Exception(sprintf('Only moving over an element is supported. Please pass a \'%s\' instance.', Element::class));
80+
throw new \PHPUnit\Extensions\Selenium2TestCase\Exception(sprintf('Only moving over an element is supported. Please pass a \'%s\' instance.', Element::class));
8181
}
8282

8383
$jsonParameters['element'] = $jsonParameters['element']->getId();

PHPUnit/Extensions/Selenium2TestCase/WaitUntil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ public function __construct(Selenium2TestCase $testCase)
8080
* @param null|int $timeout
8181
* @param null|int $sleepInterval the delay between 2 iterations of the callback
8282
* @return mixed
83-
* @throws PHPUnit_Extensions_Selenium2TestCase_Exception
83+
* @throws \PHPUnit\Extensions\Selenium2TestCase\Exception
8484
* @throws PHPUnit_Extensions_Selenium2TestCase_WebDriverException
8585
*/
8686
public function run($callback, $timeout = NULL, $sleepInterval = NULL)
8787
{
8888
if (!is_callable($callback)) {
89-
throw new PHPUnit_Extensions_Selenium2TestCase_Exception('The valid callback is expected');
89+
throw new \PHPUnit\Extensions\Selenium2TestCase\Exception('The valid callback is expected');
9090
}
9191

9292
// if there was an implicit timeout specified - remember it and temporarily turn it off

PHPUnit/Extensions/Selenium2TestCase/WebDriverException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* @link http://www.phpunit.de/
5454
* @since
5555
*/
56-
class PHPUnit_Extensions_Selenium2TestCase_WebDriverException extends PHPUnit_Extensions_Selenium2TestCase_Exception
56+
class PHPUnit_Extensions_Selenium2TestCase_WebDriverException extends \PHPUnit\Extensions\Selenium2TestCase\Exception
5757
{
5858
/* @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes */
5959
const Success = 0;

0 commit comments

Comments
 (0)