@@ -26,17 +26,17 @@ public function testConstructor()
26
26
$ r = new \ReflectionObject ($ input );
27
27
$ p = $ r ->getProperty ('tokens ' );
28
28
29
- $ this ->assertEquals (['foo ' ], $ p ->getValue ($ input ), '__construct() automatically get its input from the argv server variable ' );
29
+ $ this ->assertSame (['foo ' ], $ p ->getValue ($ input ), '__construct() automatically get its input from the argv server variable ' );
30
30
}
31
31
32
32
public function testParseArguments ()
33
33
{
34
34
$ input = new ArgvInput (['cli.php ' , 'foo ' ]);
35
35
$ input ->bind (new InputDefinition ([new InputArgument ('name ' )]));
36
- $ this ->assertEquals (['name ' => 'foo ' ], $ input ->getArguments (), '->parse() parses required arguments ' );
36
+ $ this ->assertSame (['name ' => 'foo ' ], $ input ->getArguments (), '->parse() parses required arguments ' );
37
37
38
38
$ input ->bind (new InputDefinition ([new InputArgument ('name ' )]));
39
- $ this ->assertEquals (['name ' => 'foo ' ], $ input ->getArguments (), '->parse() is stateless ' );
39
+ $ this ->assertSame (['name ' => 'foo ' ], $ input ->getArguments (), '->parse() is stateless ' );
40
40
}
41
41
42
42
/**
@@ -57,7 +57,7 @@ public function testParseOptionsNegatable($input, $options, $expectedOptions, $m
57
57
{
58
58
$ input = new ArgvInput ($ input );
59
59
$ input ->bind (new InputDefinition ($ options ));
60
- $ this ->assertEquals ($ expectedOptions , $ input ->getOptions (), $ message );
60
+ $ this ->assertSame ($ expectedOptions , $ input ->getOptions (), $ message );
61
61
}
62
62
63
63
public static function provideOptions ()
@@ -363,19 +363,19 @@ public function testParseArrayArgument()
363
363
$ input = new ArgvInput (['cli.php ' , 'foo ' , 'bar ' , 'baz ' , 'bat ' ]);
364
364
$ input ->bind (new InputDefinition ([new InputArgument ('name ' , InputArgument::IS_ARRAY )]));
365
365
366
- $ this ->assertEquals (['name ' => ['foo ' , 'bar ' , 'baz ' , 'bat ' ]], $ input ->getArguments (), '->parse() parses array arguments ' );
366
+ $ this ->assertSame (['name ' => ['foo ' , 'bar ' , 'baz ' , 'bat ' ]], $ input ->getArguments (), '->parse() parses array arguments ' );
367
367
}
368
368
369
369
public function testParseArrayOption ()
370
370
{
371
371
$ input = new ArgvInput (['cli.php ' , '--name=foo ' , '--name=bar ' , '--name=baz ' ]);
372
372
$ input ->bind (new InputDefinition ([new InputOption ('name ' , null , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY )]));
373
373
374
- $ this ->assertEquals (['name ' => ['foo ' , 'bar ' , 'baz ' ]], $ input ->getOptions (), '->parse() parses array options ("--option=value" syntax) ' );
374
+ $ this ->assertSame (['name ' => ['foo ' , 'bar ' , 'baz ' ]], $ input ->getOptions (), '->parse() parses array options ("--option=value" syntax) ' );
375
375
376
376
$ input = new ArgvInput (['cli.php ' , '--name ' , 'foo ' , '--name ' , 'bar ' , '--name ' , 'baz ' ]);
377
377
$ input ->bind (new InputDefinition ([new InputOption ('name ' , null , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY )]));
378
- $ this ->assertEquals (['name ' => ['foo ' , 'bar ' , 'baz ' ]], $ input ->getOptions (), '->parse() parses array options ("--option value" syntax) ' );
378
+ $ this ->assertSame (['name ' => ['foo ' , 'bar ' , 'baz ' ]], $ input ->getOptions (), '->parse() parses array options ("--option value" syntax) ' );
379
379
380
380
$ input = new ArgvInput (['cli.php ' , '--name=foo ' , '--name=bar ' , '--name= ' ]);
381
381
$ input ->bind (new InputDefinition ([new InputOption ('name ' , null , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY )]));
@@ -393,20 +393,20 @@ public function testParseNegativeNumberAfterDoubleDash()
393
393
{
394
394
$ input = new ArgvInput (['cli.php ' , '-- ' , '-1 ' ]);
395
395
$ input ->bind (new InputDefinition ([new InputArgument ('number ' )]));
396
- $ this ->assertEquals (['number ' => '-1 ' ], $ input ->getArguments (), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence ' );
396
+ $ this ->assertSame (['number ' => '-1 ' ], $ input ->getArguments (), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence ' );
397
397
398
398
$ input = new ArgvInput (['cli.php ' , '-f ' , 'bar ' , '-- ' , '-1 ' ]);
399
399
$ input ->bind (new InputDefinition ([new InputArgument ('number ' ), new InputOption ('foo ' , 'f ' , InputOption::VALUE_OPTIONAL )]));
400
- $ this ->assertEquals (['foo ' => 'bar ' ], $ input ->getOptions (), '->parse() parses arguments with leading dashes as options before having encountered a double-dash sequence ' );
401
- $ this ->assertEquals (['number ' => '-1 ' ], $ input ->getArguments (), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence ' );
400
+ $ this ->assertSame (['foo ' => 'bar ' ], $ input ->getOptions (), '->parse() parses arguments with leading dashes as options before having encountered a double-dash sequence ' );
401
+ $ this ->assertSame (['number ' => '-1 ' ], $ input ->getArguments (), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence ' );
402
402
}
403
403
404
404
public function testParseEmptyStringArgument ()
405
405
{
406
406
$ input = new ArgvInput (['cli.php ' , '-f ' , 'bar ' , '' ]);
407
407
$ input ->bind (new InputDefinition ([new InputArgument ('empty ' ), new InputOption ('foo ' , 'f ' , InputOption::VALUE_OPTIONAL )]));
408
408
409
- $ this ->assertEquals (['empty ' => '' ], $ input ->getArguments (), '->parse() parses empty string arguments ' );
409
+ $ this ->assertSame (['empty ' => '' ], $ input ->getArguments (), '->parse() parses empty string arguments ' );
410
410
}
411
411
412
412
public function testGetFirstArgument ()
@@ -415,7 +415,7 @@ public function testGetFirstArgument()
415
415
$ this ->assertNull ($ input ->getFirstArgument (), '->getFirstArgument() returns null when there is no arguments ' );
416
416
417
417
$ input = new ArgvInput (['cli.php ' , '-fbbar ' , 'foo ' ]);
418
- $ this ->assertEquals ('foo ' , $ input ->getFirstArgument (), '->getFirstArgument() returns the first argument from the raw input ' );
418
+ $ this ->assertSame ('foo ' , $ input ->getFirstArgument (), '->getFirstArgument() returns the first argument from the raw input ' );
419
419
420
420
$ input = new ArgvInput (['cli.php ' , '--foo ' , 'fooval ' , 'bar ' ]);
421
421
$ input ->bind (new InputDefinition ([new InputOption ('foo ' , 'f ' , InputOption::VALUE_OPTIONAL ), new InputArgument ('arg ' )]));
@@ -495,18 +495,18 @@ public function testNoWarningOnInvalidParameterOption()
495
495
// No warning thrown
496
496
$ this ->assertFalse ($ input ->hasParameterOption (['-m ' , '' ]));
497
497
498
- $ this ->assertEquals ('dev ' , $ input ->getParameterOption (['-e ' , '' ]));
498
+ $ this ->assertSame ('dev ' , $ input ->getParameterOption (['-e ' , '' ]));
499
499
// No warning thrown
500
500
$ this ->assertFalse ($ input ->getParameterOption (['-m ' , '' ]));
501
501
}
502
502
503
503
public function testToString ()
504
504
{
505
505
$ input = new ArgvInput (['cli.php ' , '-f ' , 'foo ' ]);
506
- $ this ->assertEquals ('-f foo ' , (string ) $ input );
506
+ $ this ->assertSame ('-f foo ' , (string ) $ input );
507
507
508
508
$ input = new ArgvInput (['cli.php ' , '-f ' , '--bar=foo ' , 'a b c d ' , "A \nB'C " ]);
509
- $ this ->assertEquals ('-f --bar=foo ' .escapeshellarg ('a b c d ' ).' ' .escapeshellarg ("A \nB'C " ), (string ) $ input );
509
+ $ this ->assertSame ('-f --bar=foo ' .escapeshellarg ('a b c d ' ).' ' .escapeshellarg ("A \nB'C " ), (string ) $ input );
510
510
}
511
511
512
512
/**
@@ -515,7 +515,7 @@ public function testToString()
515
515
public function testGetParameterOptionEqualSign ($ argv , $ key , $ default , $ onlyParams , $ expected )
516
516
{
517
517
$ input = new ArgvInput ($ argv );
518
- $ this ->assertEquals ($ expected , $ input ->getParameterOption ($ key , $ default , $ onlyParams ), '->getParameterOption() returns the expected value ' );
518
+ $ this ->assertSame ($ expected , $ input ->getParameterOption ($ key , $ default , $ onlyParams ), '->getParameterOption() returns the expected value ' );
519
519
}
520
520
521
521
public static function provideGetParameterOptionValues ()
@@ -539,33 +539,33 @@ public function testParseSingleDashAsArgument()
539
539
{
540
540
$ input = new ArgvInput (['cli.php ' , '- ' ]);
541
541
$ input ->bind (new InputDefinition ([new InputArgument ('file ' )]));
542
- $ this ->assertEquals (['file ' => '- ' ], $ input ->getArguments (), '->parse() parses single dash as an argument ' );
542
+ $ this ->assertSame (['file ' => '- ' ], $ input ->getArguments (), '->parse() parses single dash as an argument ' );
543
543
}
544
544
545
545
public function testParseOptionWithValueOptionalGivenEmptyAndRequiredArgument ()
546
546
{
547
547
$ input = new ArgvInput (['cli.php ' , '--foo= ' , 'bar ' ]);
548
548
$ input ->bind (new InputDefinition ([new InputOption ('foo ' , 'f ' , InputOption::VALUE_OPTIONAL ), new InputArgument ('name ' , InputArgument::REQUIRED )]));
549
- $ this ->assertEquals (['foo ' => null ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
550
- $ this ->assertEquals (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses required arguments ' );
549
+ $ this ->assertSame (['foo ' => '' ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
550
+ $ this ->assertSame (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses required arguments ' );
551
551
552
552
$ input = new ArgvInput (['cli.php ' , '--foo=0 ' , 'bar ' ]);
553
553
$ input ->bind (new InputDefinition ([new InputOption ('foo ' , 'f ' , InputOption::VALUE_OPTIONAL ), new InputArgument ('name ' , InputArgument::REQUIRED )]));
554
- $ this ->assertEquals (['foo ' => '0 ' ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
555
- $ this ->assertEquals (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses required arguments ' );
554
+ $ this ->assertSame (['foo ' => '0 ' ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
555
+ $ this ->assertSame (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses required arguments ' );
556
556
}
557
557
558
558
public function testParseOptionWithValueOptionalGivenEmptyAndOptionalArgument ()
559
559
{
560
560
$ input = new ArgvInput (['cli.php ' , '--foo= ' , 'bar ' ]);
561
561
$ input ->bind (new InputDefinition ([new InputOption ('foo ' , 'f ' , InputOption::VALUE_OPTIONAL ), new InputArgument ('name ' , InputArgument::OPTIONAL )]));
562
- $ this ->assertEquals (['foo ' => null ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
563
- $ this ->assertEquals (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses optional arguments ' );
562
+ $ this ->assertSame (['foo ' => '' ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
563
+ $ this ->assertSame (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses optional arguments ' );
564
564
565
565
$ input = new ArgvInput (['cli.php ' , '--foo=0 ' , 'bar ' ]);
566
566
$ input ->bind (new InputDefinition ([new InputOption ('foo ' , 'f ' , InputOption::VALUE_OPTIONAL ), new InputArgument ('name ' , InputArgument::OPTIONAL )]));
567
- $ this ->assertEquals (['foo ' => '0 ' ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
568
- $ this ->assertEquals (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses optional arguments ' );
567
+ $ this ->assertSame (['foo ' => '0 ' ], $ input ->getOptions (), '->parse() parses optional options with empty value as null ' );
568
+ $ this ->assertSame (['name ' => 'bar ' ], $ input ->getArguments (), '->parse() parses optional arguments ' );
569
569
}
570
570
571
571
public function testGetRawTokensFalse ()
0 commit comments