Skip to content

Commit 8aa0f01

Browse files
committed
Fix invalid test
1 parent 6855fac commit 8aa0f01

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/internal/Magento/Framework/App/Test/Unit/MaintenanceModeTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,22 +545,25 @@ public function testOnSetMultipleAddressRangesMixed()
545545
public function testOffSetMultipleAddresses()
546546
{
547547
$mapisExist = [
548-
[MaintenanceMode::FLAG_FILENAME, false],
548+
[MaintenanceMode::FLAG_FILENAME, true],
549549
[MaintenanceMode::IP_FILENAME, true],
550550
];
551551
$this->flagDir->method('isExist')
552552
->willReturnMap($mapisExist);
553553
$this->flagDir->method('delete')
554554
->willReturnMap($mapisExist);
555555

556+
$inputString = '127.0.0.1,203.0.113.71/32,10.50.60.123/32';
556557
$this->flagDir->method('readFile')
557558
->with(MaintenanceMode::IP_FILENAME)
558-
->willReturn('203.0.113.71/32,10.50.60.123/32');
559+
->willReturn($inputString);
559560

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);
562563
$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'));
563566
$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'));
565568
}
566569
}

0 commit comments

Comments
 (0)