@@ -509,64 +509,64 @@ public function getAddingAlreadySetDefinitionElementData()
509
509
array (new InputOption ('query ' , 'q ' , InputOption::VALUE_NONE )),
510
510
);
511
511
}
512
-
512
+
513
513
public function testGetDefaultHelperSetReturnsDefaultValues ()
514
514
{
515
515
$ application = new Application ();
516
516
$ application ->setAutoExit (false );
517
517
$ application ->setCatchExceptions (false );
518
-
518
+
519
519
$ helperSet = $ application ->getHelperSet ();
520
-
520
+
521
521
$ this ->assertTrue ($ helperSet ->has ('formatter ' ));
522
522
$ this ->assertTrue ($ helperSet ->has ('dialog ' ));
523
523
$ this ->assertTrue ($ helperSet ->has ('progress ' ));
524
524
}
525
-
525
+
526
526
public function testAddingSingleHelperSetOverwritesDefaultValues ()
527
527
{
528
528
$ application = new Application ();
529
529
$ application ->setAutoExit (false );
530
530
$ application ->setCatchExceptions (false );
531
-
531
+
532
532
$ application ->setHelperSet (new HelperSet (array (new FormatterHelper ())));
533
-
533
+
534
534
$ helperSet = $ application ->getHelperSet ();
535
-
535
+
536
536
$ this ->assertTrue ($ helperSet ->has ('formatter ' ));
537
-
537
+
538
538
// no other default helper set should be returned
539
539
$ this ->assertFalse ($ helperSet ->has ('dialog ' ));
540
540
$ this ->assertFalse ($ helperSet ->has ('progress ' ));
541
541
}
542
-
542
+
543
543
public function testOverwritingDefaultHelperSetOverwritesDefaultValues ()
544
544
{
545
545
$ application = new CustomApplication ();
546
546
$ application ->setAutoExit (false );
547
547
$ application ->setCatchExceptions (false );
548
-
548
+
549
549
$ application ->setHelperSet (new HelperSet (array (new FormatterHelper ())));
550
-
550
+
551
551
$ helperSet = $ application ->getHelperSet ();
552
-
552
+
553
553
$ this ->assertTrue ($ helperSet ->has ('formatter ' ));
554
-
554
+
555
555
// no other default helper set should be returned
556
556
$ this ->assertFalse ($ helperSet ->has ('dialog ' ));
557
557
$ this ->assertFalse ($ helperSet ->has ('progress ' ));
558
558
}
559
-
559
+
560
560
public function testGetDefaultInputDefinitionReturnsDefaultValues ()
561
561
{
562
562
$ application = new Application ();
563
563
$ application ->setAutoExit (false );
564
564
$ application ->setCatchExceptions (false );
565
-
565
+
566
566
$ inputDefinition = $ application ->getDefinition ();
567
567
568
568
$ this ->assertTrue ($ inputDefinition ->hasArgument ('command ' ));
569
-
569
+
570
570
$ this ->assertTrue ($ inputDefinition ->hasOption ('help ' ));
571
571
$ this ->assertTrue ($ inputDefinition ->hasOption ('quiet ' ));
572
572
$ this ->assertTrue ($ inputDefinition ->hasOption ('verbose ' ));
@@ -575,26 +575,26 @@ public function testGetDefaultInputDefinitionReturnsDefaultValues()
575
575
$ this ->assertTrue ($ inputDefinition ->hasOption ('no-ansi ' ));
576
576
$ this ->assertTrue ($ inputDefinition ->hasOption ('no-interaction ' ));
577
577
}
578
-
578
+
579
579
public function testOverwritingDefaultInputDefinitionOverwritesDefaultValues ()
580
580
{
581
581
$ application = new CustomApplication ();
582
582
$ application ->setAutoExit (false );
583
583
$ application ->setCatchExceptions (false );
584
-
584
+
585
585
$ inputDefinition = $ application ->getDefinition ();
586
586
587
587
// check wether the default arguments and options are not returned any more
588
588
$ this ->assertFalse ($ inputDefinition ->hasArgument ('command ' ));
589
-
589
+
590
590
$ this ->assertFalse ($ inputDefinition ->hasOption ('help ' ));
591
591
$ this ->assertFalse ($ inputDefinition ->hasOption ('quiet ' ));
592
592
$ this ->assertFalse ($ inputDefinition ->hasOption ('verbose ' ));
593
593
$ this ->assertFalse ($ inputDefinition ->hasOption ('version ' ));
594
594
$ this ->assertFalse ($ inputDefinition ->hasOption ('ansi ' ));
595
595
$ this ->assertFalse ($ inputDefinition ->hasOption ('no-ansi ' ));
596
596
$ this ->assertFalse ($ inputDefinition ->hasOption ('no-interaction ' ));
597
-
597
+
598
598
$ this ->assertTrue ($ inputDefinition ->hasOption ('custom ' ));
599
599
}
600
600
}
@@ -610,7 +610,7 @@ protected function getDefaultInputDefinition()
610
610
{
611
611
return new InputDefinition (array (new InputOption ('--custom ' , '-c ' , InputOption::VALUE_NONE , 'Set the custom input definition. ' )));
612
612
}
613
-
613
+
614
614
/**
615
615
* Gets the default helper set with the helpers that should always be available.
616
616
*
0 commit comments