@@ -441,7 +441,7 @@ public function testGetValueReturnsAnArrayWhenMultipleAttributeIsSet()
441441 $ this ->assertSame ([], $ select ->getValue ());
442442 }
443443
444- public function testNullAndTheEmptyStringAreEquallyHandled ()
444+ public function testNullAndTheEmptyStringValuesAreEquallyHandled ()
445445 {
446446 $ form = new Form ();
447447 $ form ->addElement ('select ' , 'select ' , [
@@ -462,8 +462,6 @@ public function testNullAndTheEmptyStringAreEquallyHandled()
462462 $ this ->assertNull ($ select2 ->getValue ());
463463
464464 $ this ->assertInstanceOf (SelectOption::class, $ select ->getOption ('' ));
465- $ this ->assertInstanceOf (SelectOption::class, $ select2 ->getOption (null ));
466- $ this ->assertInstanceOf (SelectOption::class, $ select ->getOption (null ));
467465 $ this ->assertInstanceOf (SelectOption::class, $ select2 ->getOption ('' ));
468466
469467 $ this ->assertTrue ($ select ->isValid ());
@@ -496,25 +494,6 @@ public function testNullAndTheEmptyStringAreEquallyHandled()
496494 $ this ->assertNull ($ select2 ->getValue ());
497495 }
498496
499- public function testGetOptionGetValueAndElementGetValueHandleNullAndTheEmptyStringEqually ()
500- {
501- $ select = new SelectElement ('select ' );
502- $ select ->setOptions (['' => 'Foo ' ]);
503- $ select ->setValue ('' );
504-
505- $ this ->assertNull ($ select ->getValue ());
506- $ this ->assertNull ($ select ->getOption ('' )->getValue ());
507-
508- $ select = new SelectElement ('select ' );
509- $ select ->setOptions (['' => 'Foo ' ]);
510-
511- $ this ->assertNull ($ select ->getValue ());
512- $ this ->assertNull ($ select ->getOption (null )->getValue ());
513- }
514-
515- /**
516- * @depends testNullAndTheEmptyStringAreEquallyHandled
517- */
518497 public function testDisablingOptionsIsWorking ()
519498 {
520499 $ form = new Form ();
@@ -536,29 +515,18 @@ public function testDisablingOptionsIsWorking()
536515 $ this ->assertHtml ($ html , $ form ->getElement ('select ' ));
537516 }
538517
539- public function testNullAndTheEmptyStringAreAlsoEquallyHandledWhileDisablingOptions ()
518+ public function testNullAndTheEmptyStringAreEquallyHandledWhileDisablingOptions ()
540519 {
541520 $ select = new SelectElement ('select ' );
542521 $ select ->setOptions (['' => 'Foo ' , 'bar ' => 'Bar ' ]);
543522 $ select ->setDisabledOptions ([null ]);
544523
545- $ this ->assertTrue ($ select ->getOption (null )->getAttributes ()->get ('disabled ' )->getValue ());
546-
547- $ select = new SelectElement ('select ' );
548- $ select ->setOptions (['' => 'Foo ' , 'bar ' => 'Bar ' ]);
549- $ select ->setDisabledOptions (['' ]);
550-
551524 $ this ->assertTrue ($ select ->getOption ('' )->getAttributes ()->get ('disabled ' )->getValue ());
552525
553526 $ select = new SelectElement ('select ' );
554527 $ select ->setOptions (['' => 'Foo ' , 'bar ' => 'Bar ' ]);
555528 $ select ->setDisabledOptions (['' ]);
556529
557- $ this ->assertTrue ($ select ->getOption (null )->getAttributes ()->get ('disabled ' )->getValue ());
558- $ select = new SelectElement ('select ' );
559- $ select ->setOptions (['' => 'Foo ' , 'bar ' => 'Bar ' ]);
560- $ select ->setDisabledOptions ([null ]);
561-
562530 $ this ->assertTrue ($ select ->getOption ('' )->getAttributes ()->get ('disabled ' )->getValue ());
563531 }
564532
@@ -614,13 +582,19 @@ public function testGetOptionReturnsPreviouslySetOption()
614582 $ select = new SelectElement ('select ' );
615583 $ select ->setOptions (['' => 'Empty String ' , 'foo ' => 'Foo ' , 'bar ' => 'Bar ' ]);
616584
617- $ this ->assertNull ($ select ->getOption ('' )->getValue ());
585+ $ this ->assertSame ('' , $ select ->getOption ('' )->getValue ());
586+ $ this ->assertSame ('Empty String ' , $ select ->getOption ('' )->getLabel ());
587+
618588 $ this ->assertSame ('foo ' , $ select ->getOption ('foo ' )->getValue ());
589+ $ this ->assertSame ('Foo ' , $ select ->getOption ('foo ' )->getLabel ());
619590
620591 $ select ->setOptions (['' => 'Please Choose ' , 'car ' => 'Car ' , 'train ' => 'Train ' ]);
621592
622- $ this ->assertNull ($ select ->getOption ('' )->getValue ());
593+ $ this ->assertSame ('' , $ select ->getOption ('' )->getValue ());
594+ $ this ->assertSame ('Please Choose ' , $ select ->getOption ('' )->getLabel ());
595+
623596 $ this ->assertSame ('car ' , $ select ->getOption ('car ' )->getValue ());
597+ $ this ->assertSame ('Car ' , $ select ->getOption ('car ' )->getLabel ());
624598 }
625599
626600 public function testSetDisabledOptionsResetsDisabledOptions ()
0 commit comments