1 | <?php |
||
8 | class RealWorldTest extends \PHPUnit_Framework_TestCase |
||
9 | { |
||
10 | private $json_data; |
||
11 | |||
12 | protected function setUp() |
||
13 | { |
||
14 | parent::setUp(); |
||
15 | $this->json_data = json_decode(file_get_contents(__DIR__ . '/../data/real_world_data.json'), true); |
||
16 | } |
||
17 | |||
18 | public function testConsolidateSubnets() |
||
19 | { |
||
20 | $this->assertEquals( |
||
21 | $this->json_data['consolidated_subnets'], |
||
22 | SubMuncher::consolidate_subnets($this->json_data['subnets']) |
||
23 | ); |
||
24 | } |
||
25 | |||
26 | public function testConsolidateSubnetsVerbose() |
||
27 | { |
||
28 | $this->assertEquals( |
||
29 | [ |
||
30 | 'consolidated_subnets' => $this->json_data['consolidated_subnets'], |
||
31 | 'initial_IPs' => $this->json_data['raw_ips'], |
||
32 | 'total_IPs' => $this->json_data['raw_ips'], |
||
33 | ], |
||
34 | SubMuncher::consolidate_subnets_verbose($this->json_data['subnets']) |
||
35 | ); |
||
36 | } |
||
37 | |||
38 | public function testConsolidateSubnetsPerformance() |
||
43 | |||
44 | public function testConsolidateSubnetsWithMaxRules() |
||
45 | { |
||
46 | $result = SubMuncher::consolidate_subnets($this->json_data['subnets'], 25); |
||
61 | } |
||
62 |
It seems like you are relying on a variable being defined by an iteration: