| 1 | <?php |
||
| 21 | /** |
||
| 22 | * Tests the service definitions. |
||
| 23 | */ |
||
| 24 | class BootstrapTest extends KernelTestCase |
||
| 25 | { |
||
| 26 | public function testBootstrap() |
||
| 27 | { |
||
| 28 | $this->bootKernel(); |
||
| 29 | |||
| 30 | $scheduler = self::$kernel->getContainer()->get('task.scheduler'); |
||
| 31 | $taskRepository = self::$kernel->getContainer()->get('task.storage.task'); |
||
| 32 | $taskExecutionRepository = self::$kernel->getContainer()->get('task.storage.task_execution'); |
||
| 33 | |||
| 34 | $this->assertInstanceOf(TaskSchedulerInterface::class, $scheduler); |
||
| 35 | |||
| 36 | switch (self::$kernel->getContainer()->getParameter('kernel.storage')) { |
||
| 37 | case 'array': |
||
| 38 | $this->assertInstanceOf(ArrayTaskRepository::class, $taskRepository); |
||
| 39 | $this->assertInstanceOf(ArrayTaskExecutionRepository::class, $taskExecutionRepository); |
||
| 40 | break; |
||
| 41 | case 'doctrine': |
||
| 42 | $this->assertInstanceOf(TaskRepository::class, $taskRepository); |
||
| 43 | $this->assertInstanceOf(TaskExecutionRepository::class, $taskExecutionRepository); |
||
| 44 | break; |
||
| 45 | default: |
||
| 46 | $this->fail('storage not supported'); |
||
| 47 | break; |
||
| 48 | } |
||
| 51 |