| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function testMigrate(): void |
||
| 20 | { |
||
| 21 | /** @var Database $db */ |
||
| 22 | $db = $this->app->get(Database::class); |
||
| 23 | $this->assertSame([], $db->getTables()); |
||
| 24 | |||
| 25 | $out = $this->runCommandDebug('migrate:status'); |
||
| 26 | $this->assertStringContainsString('not', $out); |
||
| 27 | |||
| 28 | $this->runCommandDebug('migrate:init'); |
||
| 29 | |||
| 30 | $out = $this->runCommandDebug('migrate:status'); |
||
| 31 | $this->assertStringContainsString('No', $out); |
||
| 32 | |||
| 33 | $this->runCommandDebug('cycle:migrate'); |
||
| 34 | $this->assertSame(1, count($db->getTables())); |
||
| 35 | |||
| 36 | $out = $this->runCommandDebug('migrate:status'); |
||
| 37 | $this->assertStringContainsString('not executed yet', $out); |
||
| 38 | |||
| 39 | $this->runCommandDebug('migrate'); |
||
| 40 | $this->assertSame(3, count($db->getTables())); |
||
| 41 | |||
| 42 | $out2 = $this->runCommandDebug('migrate:status'); |
||
| 43 | $this->assertNotSame($out, $out2); |
||
| 44 | } |
||
| 46 |