Skip to content
Closed
Changes from 1 commit
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
19 changes: 9 additions & 10 deletions PHPUnit/Extensions/Selenium2TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
namespace PHPUnit\Extensions;

use Exception;
use InvalidArgumentException;
use PHPUnit\Extensions\Selenium2TestCase\Element;
use PHPUnit\Extensions\Selenium2TestCase\Element\Select;
use PHPUnit\Extensions\Selenium2TestCase\ElementCriteria;
Expand All @@ -60,9 +59,9 @@
use PHPUnit\Extensions\Selenium2TestCase\WaitUntil;
use PHPUnit\Extensions\Selenium2TestCase\Window;
use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage;
use PHPUnit\Framework\InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\TestResult;
use PHPUnit\Util\InvalidArgumentHelper;
use RuntimeException;
use Throwable;

Expand Down Expand Up @@ -199,7 +198,7 @@ abstract class Selenium2TestCase extends TestCase
public static function shareSession($shareSession)
{
if (!is_bool($shareSession)) {
throw new InvalidArgumentException("The shared session support can only be switched on or off.");
throw new \InvalidArgumentException("The shared session support can only be switched on or off.");
}
if (!$shareSession) {
self::$sessionStrategy = self::defaultSessionStrategy();
Expand All @@ -213,7 +212,7 @@ public static function shareSession($shareSession)
public static function keepSessionOnFailure($keepSession)
{
if (!is_bool($keepSession)) {
throw new InvalidArgumentException("The keep session on fail support can only be switched on or off.");
throw new \InvalidArgumentException("The keep session on fail support can only be switched on or off.");
}
if ($keepSession){
self::$keepSessionOnFailure = TRUE;
Expand Down Expand Up @@ -312,7 +311,7 @@ protected function setUpSessionStrategy($params)
} elseif (isset($params['sessionStrategy'])) {
$strat = $params['sessionStrategy'];
if ($strat != "isolated" && $strat != "shared") {
throw new InvalidArgumentException("Session strategy must be either 'isolated' or 'shared'");
throw new \InvalidArgumentException("Session strategy must be either 'isolated' or 'shared'");
} elseif ($strat == "isolated") {
self::$browserSessionStrategy = new Isolated;
} else {
Expand Down Expand Up @@ -450,7 +449,7 @@ public function __call($command, $arguments)
public function setHost($host)
{
if (!is_string($host)) {
throw InvalidArgumentHelper::factory(1, 'string');
throw InvalidArgumentException::create(1, 'string');
}

$this->parameters['host'] = $host;
Expand All @@ -468,7 +467,7 @@ public function getHost()
public function setPort($port)
{
if (!is_int($port)) {
throw InvalidArgumentHelper::factory(1, 'integer');
throw InvalidArgumentException::create(1, 'integer');
}

$this->parameters['port'] = $port;
Expand All @@ -486,7 +485,7 @@ public function getPort()
public function setSecure($secure)
{
if(!is_bool($secure)) {
throw InvalidArgumentHelper::factory(1, 'boolean');
throw InvalidArgumentException::create(1, 'boolean');
}

$this->parameters['secure'] = $secure;
Expand All @@ -504,7 +503,7 @@ public function getSecure()
public function setBrowser($browserName)
{
if (!is_string($browserName)) {
throw InvalidArgumentHelper::factory(1, 'string');
throw InvalidArgumentException::create(1, 'string');
}

$this->parameters['browserName'] = $browserName;
Expand All @@ -522,7 +521,7 @@ public function getBrowser()
public function setBrowserUrl($browserUrl)
{
if (!is_string($browserUrl)) {
throw InvalidArgumentHelper::factory(1, 'string');
throw InvalidArgumentException::create(1, 'string');
}

$this->parameters['browserUrl'] = new URL($browserUrl);
Expand Down