45
45
namespace PHPUnit \Extensions ;
46
46
47
47
use Exception ;
48
- use InvalidArgumentException ;
49
48
use PHPUnit \Extensions \Selenium2TestCase \Element ;
50
49
use PHPUnit \Extensions \Selenium2TestCase \Element \Select ;
51
50
use PHPUnit \Extensions \Selenium2TestCase \ElementCriteria ;
60
59
use PHPUnit \Extensions \Selenium2TestCase \WaitUntil ;
61
60
use PHPUnit \Extensions \Selenium2TestCase \Window ;
62
61
use PHPUnit \Extensions \SeleniumCommon \RemoteCoverage ;
62
+ use PHPUnit \Framework \InvalidArgumentException ;
63
63
use PHPUnit \Framework \TestCase ;
64
64
use PHPUnit \Framework \TestResult ;
65
- use PHPUnit \Util \InvalidArgumentHelper ;
66
65
use RuntimeException ;
67
66
use Throwable ;
68
67
@@ -199,7 +198,7 @@ abstract class Selenium2TestCase extends TestCase
199
198
public static function shareSession ($ shareSession )
200
199
{
201
200
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. " );
203
202
}
204
203
if (!$ shareSession ) {
205
204
self ::$ sessionStrategy = self ::defaultSessionStrategy ();
@@ -213,7 +212,7 @@ public static function shareSession($shareSession)
213
212
public static function keepSessionOnFailure ($ keepSession )
214
213
{
215
214
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. " );
217
216
}
218
217
if ($ keepSession ){
219
218
self ::$ keepSessionOnFailure = TRUE ;
@@ -312,7 +311,7 @@ protected function setUpSessionStrategy($params)
312
311
} elseif (isset ($ params ['sessionStrategy ' ])) {
313
312
$ strat = $ params ['sessionStrategy ' ];
314
313
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' " );
316
315
} elseif ($ strat == "isolated " ) {
317
316
self ::$ browserSessionStrategy = new Isolated ;
318
317
} else {
@@ -450,7 +449,7 @@ public function __call($command, $arguments)
450
449
public function setHost ($ host )
451
450
{
452
451
if (!is_string ($ host )) {
453
- throw InvalidArgumentHelper:: factory (1 , 'string ' );
452
+ throw InvalidArgumentException:: create (1 , 'string ' );
454
453
}
455
454
456
455
$ this ->parameters ['host ' ] = $ host ;
@@ -468,7 +467,7 @@ public function getHost()
468
467
public function setPort ($ port )
469
468
{
470
469
if (!is_int ($ port )) {
471
- throw InvalidArgumentHelper:: factory (1 , 'integer ' );
470
+ throw InvalidArgumentException:: create (1 , 'integer ' );
472
471
}
473
472
474
473
$ this ->parameters ['port ' ] = $ port ;
@@ -486,7 +485,7 @@ public function getPort()
486
485
public function setSecure ($ secure )
487
486
{
488
487
if (!is_bool ($ secure )) {
489
- throw InvalidArgumentHelper:: factory (1 , 'boolean ' );
488
+ throw InvalidArgumentException:: create (1 , 'boolean ' );
490
489
}
491
490
492
491
$ this ->parameters ['secure ' ] = $ secure ;
@@ -504,7 +503,7 @@ public function getSecure()
504
503
public function setBrowser ($ browserName )
505
504
{
506
505
if (!is_string ($ browserName )) {
507
- throw InvalidArgumentHelper:: factory (1 , 'string ' );
506
+ throw InvalidArgumentException:: create (1 , 'string ' );
508
507
}
509
508
510
509
$ this ->parameters ['browserName ' ] = $ browserName ;
@@ -522,7 +521,7 @@ public function getBrowser()
522
521
public function setBrowserUrl ($ browserUrl )
523
522
{
524
523
if (!is_string ($ browserUrl )) {
525
- throw InvalidArgumentHelper:: factory (1 , 'string ' );
524
+ throw InvalidArgumentException:: create (1 , 'string ' );
526
525
}
527
526
528
527
$ this ->parameters ['browserUrl ' ] = new URL ($ browserUrl );
0 commit comments