@@ -545,22 +545,25 @@ public function testOnSetMultipleAddressRangesMixed()
545
545
public function testOffSetMultipleAddresses ()
546
546
{
547
547
$ mapisExist = [
548
- [MaintenanceMode::FLAG_FILENAME , false ],
548
+ [MaintenanceMode::FLAG_FILENAME , true ],
549
549
[MaintenanceMode::IP_FILENAME , true ],
550
550
];
551
551
$ this ->flagDir ->method ('isExist ' )
552
552
->willReturnMap ($ mapisExist );
553
553
$ this ->flagDir ->method ('delete ' )
554
554
->willReturnMap ($ mapisExist );
555
555
556
+ $ inputString = '127.0.0.1,203.0.113.71/32,10.50.60.123/32 ' ;
556
557
$ this ->flagDir ->method ('readFile ' )
557
558
->with (MaintenanceMode::IP_FILENAME )
558
- ->willReturn (' 203.0.113.71/32,10.50.60.123/32 ' );
559
+ ->willReturn ($ inputString );
559
560
560
- $ expectedArray = ['203.0.113.71/32 ' , '10.50.60.123/32 ' ];
561
- $ this ->model ->setAddresses (' 203.0.113.71,10.50.60.123 ' );
561
+ $ expectedArray = ['127.0.0.1 ' , ' 203.0.113.71/32 ' , '10.50.60.123/32 ' ];
562
+ $ this ->model ->setAddresses ($ inputString );
562
563
$ this ->assertEquals ($ expectedArray , $ this ->model ->getAddressInfo ());
564
+ $ this ->assertFalse ($ this ->model ->isOn ('127.0.0.1 ' ));
565
+ $ this ->assertTrue ($ this ->model ->isOn ('127.0.0.2 ' ));
563
566
$ this ->assertFalse ($ this ->model ->isOn ('203.0.113.71 ' ));
564
- $ this ->assertFalse ($ this ->model ->isOn ('198.51.100.85 ' ));
567
+ $ this ->assertTrue ($ this ->model ->isOn ('198.51.100.85 ' ));
565
568
}
566
569
}
0 commit comments