@@ -469,4 +469,49 @@ public function testHasWithNullValue()
469
469
470
470
$ this ->assertTrue ($ this ->options ->has ('foo ' ));
471
471
}
472
+
473
+ public function testRemoveOptionAndNormalizer ()
474
+ {
475
+ $ this ->options ->set ('foo1 ' , 'bar ' );
476
+ $ this ->options ->setNormalizer ('foo1 ' , function (Options $ options ) {
477
+ return '' ;
478
+ });
479
+ $ this ->options ->set ('foo2 ' , 'bar ' );
480
+ $ this ->options ->setNormalizer ('foo2 ' , function (Options $ options ) {
481
+ return '' ;
482
+ });
483
+
484
+ $ this ->options ->remove ('foo2 ' );
485
+ $ this ->assertEquals (array ('foo1 ' => '' ), $ this ->options ->all ());
486
+ }
487
+
488
+ public function testReplaceOptionAndNormalizer ()
489
+ {
490
+ $ this ->options ->set ('foo1 ' , 'bar ' );
491
+ $ this ->options ->setNormalizer ('foo1 ' , function (Options $ options ) {
492
+ return '' ;
493
+ });
494
+ $ this ->options ->set ('foo2 ' , 'bar ' );
495
+ $ this ->options ->setNormalizer ('foo2 ' , function (Options $ options ) {
496
+ return '' ;
497
+ });
498
+
499
+ $ this ->options ->replace (array ('foo1 ' => 'new ' ));
500
+ $ this ->assertEquals (array ('foo1 ' => 'new ' ), $ this ->options ->all ());
501
+ }
502
+
503
+ public function testClearOptionAndNormalizer ()
504
+ {
505
+ $ this ->options ->set ('foo1 ' , 'bar ' );
506
+ $ this ->options ->setNormalizer ('foo1 ' , function (Options $ options ) {
507
+ return '' ;
508
+ });
509
+ $ this ->options ->set ('foo2 ' , 'bar ' );
510
+ $ this ->options ->setNormalizer ('foo2 ' , function (Options $ options ) {
511
+ return '' ;
512
+ });
513
+
514
+ $ this ->options ->clear ();
515
+ $ this ->assertEmpty ($ this ->options ->all ());
516
+ }
472
517
}
0 commit comments