| 1 | <?php |
||
| 9 | class LAGAdminExtensionTest extends AdminTestBase |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * The load should allow the container to compile without errors. |
||
| 13 | */ |
||
| 14 | public function testLoad() |
||
| 15 | { |
||
| 16 | $builder = $this->getMockWithoutConstructor(ContainerBuilder::class); |
||
| 17 | $builder |
||
| 18 | ->expects($this->atLeastOnce()) |
||
| 19 | ->method('setParameter') |
||
| 20 | ->willReturnCallback(function ($parameter, $value) { |
||
| 21 | $this->assertContains($parameter, [ |
||
| 22 | 'lag.admin.enable_extra_configuration', |
||
| 23 | 'lag.admin.application_configuration', |
||
| 24 | 'lag.admins', |
||
| 25 | 'lag.menus', |
||
| 26 | ]); |
||
| 27 | |||
| 28 | if ('lag.admin.enable_extra_configuration' === $parameter) { |
||
| 29 | $this->assertContains($value, [ |
||
| 30 | true, |
||
| 31 | ]); |
||
| 32 | } |
||
| 33 | }) |
||
| 34 | ; |
||
| 35 | |||
| 36 | $extension = new LAGAdminExtension(); |
||
| 37 | $extension->load([ |
||
| 38 | 'enable_extra_configuration' => true, |
||
| 39 | ], $builder); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * The load should allow the container to compile without errors. |
||
| 44 | */ |
||
| 45 | public function testLoadWithoutConfiguration() |
||
| 46 | { |
||
| 47 | $builder = $this->getMockWithoutConstructor(ContainerBuilder::class); |
||
| 48 | |||
| 49 | $extension = new LAGAdminExtension(); |
||
| 50 | $extension->load([], $builder); |
||
| 51 | // Every thing went fine |
||
| 52 | $this->assertTrue(true); |
||
| 53 | } |
||
| 54 | } |
||
| 55 |