45
45
namespace PHPUnit \Extensions ;
46
46
47
47
use Exception ;
48
+ use InvalidArgumentException ;
48
49
use PHPUnit \Extensions \Selenium2TestCase \Element ;
49
50
use PHPUnit \Extensions \Selenium2TestCase \Element \Select ;
50
51
use PHPUnit \Extensions \Selenium2TestCase \ElementCriteria ;
59
60
use PHPUnit \Extensions \Selenium2TestCase \WaitUntil ;
60
61
use PHPUnit \Extensions \Selenium2TestCase \Window ;
61
62
use PHPUnit \Extensions \SeleniumCommon \RemoteCoverage ;
62
- use PHPUnit \Framework \InvalidArgumentException ;
63
+ use PHPUnit \Framework \InvalidArgumentException as PHPUnitInvalidArgumentException ;
63
64
use PHPUnit \Framework \TestCase ;
64
65
use PHPUnit \Framework \TestResult ;
65
66
use RuntimeException ;
@@ -198,7 +199,7 @@ abstract class Selenium2TestCase extends TestCase
198
199
public static function shareSession ($ shareSession )
199
200
{
200
201
if (!is_bool ($ shareSession )) {
201
- throw new \ InvalidArgumentException ("The shared session support can only be switched on or off. " );
202
+ throw new InvalidArgumentException ("The shared session support can only be switched on or off. " );
202
203
}
203
204
if (!$ shareSession ) {
204
205
self ::$ sessionStrategy = self ::defaultSessionStrategy ();
@@ -212,7 +213,7 @@ public static function shareSession($shareSession)
212
213
public static function keepSessionOnFailure ($ keepSession )
213
214
{
214
215
if (!is_bool ($ keepSession )) {
215
- throw new \ InvalidArgumentException ("The keep session on fail support can only be switched on or off. " );
216
+ throw new InvalidArgumentException ("The keep session on fail support can only be switched on or off. " );
216
217
}
217
218
if ($ keepSession ){
218
219
self ::$ keepSessionOnFailure = TRUE ;
@@ -311,7 +312,7 @@ protected function setUpSessionStrategy($params)
311
312
} elseif (isset ($ params ['sessionStrategy ' ])) {
312
313
$ strat = $ params ['sessionStrategy ' ];
313
314
if ($ strat != "isolated " && $ strat != "shared " ) {
314
- throw new \ InvalidArgumentException ("Session strategy must be either 'isolated' or 'shared' " );
315
+ throw new InvalidArgumentException ("Session strategy must be either 'isolated' or 'shared' " );
315
316
} elseif ($ strat == "isolated " ) {
316
317
self ::$ browserSessionStrategy = new Isolated ;
317
318
} else {
@@ -444,12 +445,12 @@ public function __call($command, $arguments)
444
445
445
446
/**
446
447
* @param string $host
447
- * @throws InvalidArgumentException
448
+ * @throws PHPUnitInvalidArgumentException
448
449
*/
449
450
public function setHost ($ host )
450
451
{
451
452
if (!is_string ($ host )) {
452
- throw InvalidArgumentException ::create (1 , 'string ' );
453
+ throw PHPUnitInvalidArgumentException ::create (1 , 'string ' );
453
454
}
454
455
455
456
$ this ->parameters ['host ' ] = $ host ;
@@ -462,12 +463,12 @@ public function getHost()
462
463
463
464
/**
464
465
* @param integer $port
465
- * @throws InvalidArgumentException
466
+ * @throws PHPUnitInvalidArgumentException
466
467
*/
467
468
public function setPort ($ port )
468
469
{
469
470
if (!is_int ($ port )) {
470
- throw InvalidArgumentException ::create (1 , 'integer ' );
471
+ throw PHPUnitInvalidArgumentException ::create (1 , 'integer ' );
471
472
}
472
473
473
474
$ this ->parameters ['port ' ] = $ port ;
@@ -480,12 +481,12 @@ public function getPort()
480
481
481
482
/**
482
483
* @param boolean $secure
483
- * @throws InvalidArgumentException
484
+ * @throws PHPUnitInvalidArgumentException
484
485
*/
485
486
public function setSecure ($ secure )
486
487
{
487
488
if (!is_bool ($ secure )) {
488
- throw InvalidArgumentException ::create (1 , 'boolean ' );
489
+ throw PHPUnitInvalidArgumentException ::create (1 , 'boolean ' );
489
490
}
490
491
491
492
$ this ->parameters ['secure ' ] = $ secure ;
@@ -498,12 +499,12 @@ public function getSecure()
498
499
499
500
/**
500
501
* @param string $browser
501
- * @throws InvalidArgumentException
502
+ * @throws PHPUnitInvalidArgumentException
502
503
*/
503
504
public function setBrowser ($ browserName )
504
505
{
505
506
if (!is_string ($ browserName )) {
506
- throw InvalidArgumentException ::create (1 , 'string ' );
507
+ throw PHPUnitInvalidArgumentException ::create (1 , 'string ' );
507
508
}
508
509
509
510
$ this ->parameters ['browserName ' ] = $ browserName ;
@@ -516,12 +517,12 @@ public function getBrowser()
516
517
517
518
/**
518
519
* @param string $browserUrl
519
- * @throws InvalidArgumentException
520
+ * @throws PHPUnitInvalidArgumentException
520
521
*/
521
522
public function setBrowserUrl ($ browserUrl )
522
523
{
523
524
if (!is_string ($ browserUrl )) {
524
- throw InvalidArgumentException ::create (1 , 'string ' );
525
+ throw PHPUnitInvalidArgumentException ::create (1 , 'string ' );
525
526
}
526
527
527
528
$ this ->parameters ['browserUrl ' ] = new URL ($ browserUrl );
0 commit comments