@@ 25-41 (lines=17) @@ | ||
22 | ||
23 | class AplTest extends TestCase |
|
24 | { |
|
25 | public function testOutput(): void |
|
26 | { |
|
27 | $includedRanges = [ |
|
28 | IPBlock::create('192.168.0.0/23'), |
|
29 | IPBlock::create('2001:acad:1::/112'), |
|
30 | ]; |
|
31 | ||
32 | $excludedRanges = [ |
|
33 | IPBlock::create('192.168.1.64/28'), |
|
34 | IPBlock::create('2001:acad:1::8/128'), |
|
35 | ]; |
|
36 | ||
37 | $apl = Factory::APL($includedRanges, $excludedRanges); |
|
38 | ||
39 | $expectation = '1:192.168.0.0/23 2:2001:acad:1::/112 !1:192.168.1.64/28 !2:2001:acad:1::8/128'; |
|
40 | $this->assertEquals($expectation, $apl->toText()); |
|
41 | } |
|
42 | ||
43 | public function testGetters(): void |
|
44 | { |
|
@@ 43-59 (lines=17) @@ | ||
40 | $this->assertEquals($expectation, $apl->toText()); |
|
41 | } |
|
42 | ||
43 | public function testGetters(): void |
|
44 | { |
|
45 | $includedRanges = [ |
|
46 | IPBlock::create('192.168.0.0/23'), |
|
47 | IPBlock::create('2001:acad:1::/112'), |
|
48 | ]; |
|
49 | ||
50 | $excludedRanges = [ |
|
51 | IPBlock::create('192.168.1.64/28'), |
|
52 | IPBlock::create('2001:acad:1::8/128'), |
|
53 | ]; |
|
54 | ||
55 | $apl = Factory::APL($includedRanges, $excludedRanges); |
|
56 | ||
57 | $this->assertEquals($includedRanges, $apl->getIncludedAddressRanges()); |
|
58 | $this->assertEquals($excludedRanges, $apl->getExcludedAddressRanges()); |
|
59 | } |
|
60 | ||
61 | /** |
|
62 | * @throws \Exception |