| @@ 50-61 (lines=12) @@ | ||
| 47 | )); |
|
| 48 | } |
|
| 49 | ||
| 50 | public function testDefaultVersion() |
|
| 51 | { |
|
| 52 | $config = $this->processConfiguration(array( |
|
| 53 | 'clients' => array( |
|
| 54 | 'foo' => array( |
|
| 55 | 'base_url' => 'http://example.com/xapi', |
|
| 56 | ), |
|
| 57 | ), |
|
| 58 | )); |
|
| 59 | ||
| 60 | $this->assertEquals('1.0.1', $config['clients']['foo']['version']); |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException |
|
| @@ 81-93 (lines=13) @@ | ||
| 78 | /** |
|
| 79 | * @dataProvider validVersions |
|
| 80 | */ |
|
| 81 | public function testValidVersion($version) |
|
| 82 | { |
|
| 83 | $config = $this->processConfiguration(array( |
|
| 84 | 'clients' => array( |
|
| 85 | 'foo' => array( |
|
| 86 | 'base_url' => 'http://example.com/xapi', |
|
| 87 | 'version' => $version, |
|
| 88 | ), |
|
| 89 | ), |
|
| 90 | )); |
|
| 91 | ||
| 92 | $this->assertEquals($version, $config['clients']['foo']['version']); |
|
| 93 | } |
|
| 94 | ||
| 95 | private function processConfiguration(array $config) |
|
| 96 | { |
|