Skip to content

Commit 2a238c0

Browse files
committed
Fix moved InvalidArgumentHelper
1 parent 7c8bef6 commit 2a238c0

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

PHPUnit/Extensions/Selenium2TestCase.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
namespace PHPUnit\Extensions;
4646

4747
use Exception;
48-
use InvalidArgumentException;
4948
use PHPUnit\Extensions\Selenium2TestCase\Element;
5049
use PHPUnit\Extensions\Selenium2TestCase\Element\Select;
5150
use PHPUnit\Extensions\Selenium2TestCase\ElementCriteria;
@@ -60,9 +59,9 @@
6059
use PHPUnit\Extensions\Selenium2TestCase\WaitUntil;
6160
use PHPUnit\Extensions\Selenium2TestCase\Window;
6261
use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage;
62+
use PHPUnit\Framework\InvalidArgumentException;
6363
use PHPUnit\Framework\TestCase;
6464
use PHPUnit\Framework\TestResult;
65-
use PHPUnit\Util\InvalidArgumentHelper;
6665
use RuntimeException;
6766
use Throwable;
6867

@@ -199,7 +198,7 @@ abstract class Selenium2TestCase extends TestCase
199198
public static function shareSession($shareSession)
200199
{
201200
if (!is_bool($shareSession)) {
202-
throw new InvalidArgumentException("The shared session support can only be switched on or off.");
201+
throw new \InvalidArgumentException("The shared session support can only be switched on or off.");
203202
}
204203
if (!$shareSession) {
205204
self::$sessionStrategy = self::defaultSessionStrategy();
@@ -213,7 +212,7 @@ public static function shareSession($shareSession)
213212
public static function keepSessionOnFailure($keepSession)
214213
{
215214
if (!is_bool($keepSession)) {
216-
throw new InvalidArgumentException("The keep session on fail support can only be switched on or off.");
215+
throw new \InvalidArgumentException("The keep session on fail support can only be switched on or off.");
217216
}
218217
if ($keepSession){
219218
self::$keepSessionOnFailure = TRUE;
@@ -312,7 +311,7 @@ protected function setUpSessionStrategy($params)
312311
} elseif (isset($params['sessionStrategy'])) {
313312
$strat = $params['sessionStrategy'];
314313
if ($strat != "isolated" && $strat != "shared") {
315-
throw new InvalidArgumentException("Session strategy must be either 'isolated' or 'shared'");
314+
throw new \InvalidArgumentException("Session strategy must be either 'isolated' or 'shared'");
316315
} elseif ($strat == "isolated") {
317316
self::$browserSessionStrategy = new Isolated;
318317
} else {
@@ -450,7 +449,7 @@ public function __call($command, $arguments)
450449
public function setHost($host)
451450
{
452451
if (!is_string($host)) {
453-
throw InvalidArgumentHelper::factory(1, 'string');
452+
throw InvalidArgumentException::create(1, 'string');
454453
}
455454

456455
$this->parameters['host'] = $host;
@@ -468,7 +467,7 @@ public function getHost()
468467
public function setPort($port)
469468
{
470469
if (!is_int($port)) {
471-
throw InvalidArgumentHelper::factory(1, 'integer');
470+
throw InvalidArgumentException::create(1, 'integer');
472471
}
473472

474473
$this->parameters['port'] = $port;
@@ -486,7 +485,7 @@ public function getPort()
486485
public function setSecure($secure)
487486
{
488487
if(!is_bool($secure)) {
489-
throw InvalidArgumentHelper::factory(1, 'boolean');
488+
throw InvalidArgumentException::create(1, 'boolean');
490489
}
491490

492491
$this->parameters['secure'] = $secure;
@@ -504,7 +503,7 @@ public function getSecure()
504503
public function setBrowser($browserName)
505504
{
506505
if (!is_string($browserName)) {
507-
throw InvalidArgumentHelper::factory(1, 'string');
506+
throw InvalidArgumentException::create(1, 'string');
508507
}
509508

510509
$this->parameters['browserName'] = $browserName;
@@ -522,7 +521,7 @@ public function getBrowser()
522521
public function setBrowserUrl($browserUrl)
523522
{
524523
if (!is_string($browserUrl)) {
525-
throw InvalidArgumentHelper::factory(1, 'string');
524+
throw InvalidArgumentException::create(1, 'string');
526525
}
527526

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

0 commit comments

Comments
 (0)