| @@ 66-102 (lines=37) @@ | ||
| 63 | ); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testProcessTwoClients() |
|
| 67 | { |
|
| 68 | $processed = $this->process([ |
|
| 69 | [ |
|
| 70 | 'clients' => [ |
|
| 71 | 'default' => [ |
|
| 72 | 'host' => '127.0.0.1', |
|
| 73 | 'port' => '9200', |
|
| 74 | ], |
|
| 75 | 'my_client' => [ |
|
| 76 | 'host' => '192.168.0.100', |
|
| 77 | 'port' => '9201', |
|
| 78 | ] |
|
| 79 | ] |
|
| 80 | ] |
|
| 81 | ]); |
|
| 82 | ||
| 83 | $this->assertArrayHasKey('connections', $processed['clients']['default']); |
|
| 84 | $this->assertEquals( |
|
| 85 | '127.0.0.1', |
|
| 86 | $processed['clients']['default']['connections'][0]['host'] |
|
| 87 | ); |
|
| 88 | $this->assertEquals( |
|
| 89 | '9200', |
|
| 90 | $processed['clients']['default']['connections'][0]['port'] |
|
| 91 | ); |
|
| 92 | ||
| 93 | $this->assertArrayHasKey('connections', $processed['clients']['my_client']); |
|
| 94 | $this->assertEquals( |
|
| 95 | '192.168.0.100', |
|
| 96 | $processed['clients']['my_client']['connections'][0]['host'] |
|
| 97 | ); |
|
| 98 | $this->assertEquals( |
|
| 99 | '9201', |
|
| 100 | $processed['clients']['my_client']['connections'][0]['port'] |
|
| 101 | ); |
|
| 102 | } |
|
| 103 | ||
| 104 | public function testProcessManyConnections() |
|
| 105 | { |
|
| @@ 104-144 (lines=41) @@ | ||
| 101 | ); |
|
| 102 | } |
|
| 103 | ||
| 104 | public function testProcessManyConnections() |
|
| 105 | { |
|
| 106 | $processed = $this->process([ |
|
| 107 | [ |
|
| 108 | 'clients' => [ |
|
| 109 | 'default' => [ |
|
| 110 | 'connections' => [ |
|
| 111 | [ |
|
| 112 | 'host' => '127.0.0.1', |
|
| 113 | 'port' => '9200', |
|
| 114 | ], |
|
| 115 | [ |
|
| 116 | 'host' => '192.168.0.100', |
|
| 117 | 'port' => '9201', |
|
| 118 | ], |
|
| 119 | ] |
|
| 120 | ], |
|
| 121 | ] |
|
| 122 | ] |
|
| 123 | ]); |
|
| 124 | ||
| 125 | $this->assertArrayHasKey('connections', $processed['clients']['default']); |
|
| 126 | $this->assertEquals( |
|
| 127 | '127.0.0.1', |
|
| 128 | $processed['clients']['default']['connections'][0]['host'] |
|
| 129 | ); |
|
| 130 | $this->assertEquals( |
|
| 131 | '9200', |
|
| 132 | $processed['clients']['default']['connections'][0]['port'] |
|
| 133 | ); |
|
| 134 | ||
| 135 | $this->assertArrayHasKey('connections', $processed['clients']['default']); |
|
| 136 | $this->assertEquals( |
|
| 137 | '192.168.0.100', |
|
| 138 | $processed['clients']['default']['connections'][1]['host'] |
|
| 139 | ); |
|
| 140 | $this->assertEquals( |
|
| 141 | '9201', |
|
| 142 | $processed['clients']['default']['connections'][1]['port'] |
|
| 143 | ); |
|
| 144 | } |
|
| 145 | ||
| 146 | ||
| 147 | public function testProcessAddDefaultValuesForConnections() |
|