Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class RulesLoaderTest extends KernelTestCase |
||
10 | { |
||
11 | protected $application; |
||
12 | |||
13 | protected function setUp(): void |
||
14 | { |
||
15 | self::bootKernel(); |
||
16 | $this->application = new Application(self::$kernel); |
||
17 | $command = $this->application->find('doctrine:database:create'); |
||
18 | $commandTester = new CommandTester($command); |
||
19 | $commandTester->execute([]); |
||
20 | $command = $this->application->find('doctrine:schema:update'); |
||
21 | $commandTester = new CommandTester($command); |
||
22 | $commandTester->execute([ |
||
23 | 'command' => $command->getName(), |
||
24 | '--force' => true |
||
25 | ]); |
||
26 | } |
||
27 | |||
28 | public function testExecute() |
||
29 | { |
||
30 | $command = $this->application->find('obblm:rules:load'); |
||
31 | $commandTester = new CommandTester($command); |
||
32 | $commandTester->execute([]); |
||
33 | |||
34 | $output = $commandTester->getDisplay(); |
||
35 | // the output of the command in the console |
||
36 | $this->assertStringContainsString('[OK] All rules have been created or updated.', $output); |
||
37 | } |
||
38 | |||
39 | protected function tearDown(): void |
||
40 | { |
||
41 | parent::tearDown(); |
||
42 | |||
43 | // doing this is recommended to avoid memory leaks |
||
44 | $this->application = null; |
||
45 | } |
||
47 |