| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 28 | public function testMigrate(): void |
||
| 29 | { |
||
| 30 | /** @var Database $db */ |
||
| 31 | $db = $this->app->get(Database::class); |
||
| 32 | $this->assertSame([], $db->getTables()); |
||
| 33 | |||
| 34 | $out = $this->runCommandDebug('migrate:status'); |
||
| 35 | $this->assertStringContainsString('No migrations', $out); |
||
| 36 | |||
| 37 | $this->runCommandDebug('migrate:init'); |
||
| 38 | |||
| 39 | $out = $this->runCommandDebug('migrate:status'); |
||
| 40 | $this->assertStringContainsString('No migrations', $out); |
||
| 41 | |||
| 42 | $this->runCommandDebug('cycle:migrate'); |
||
| 43 | $this->assertCount(0, $db->getTables()); |
||
| 44 | |||
| 45 | $out = $this->runCommandDebug('migrate:status'); |
||
| 46 | $this->assertStringContainsString('not executed yet', $out); |
||
| 47 | |||
| 48 | $this->runCommandDebug('migrate'); |
||
| 49 | $this->assertCount(3, $db->getTables()); |
||
| 50 | |||
| 51 | $out2 = $this->runCommandDebug('migrate:status'); |
||
| 52 | $this->assertNotSame($out, $out2); |
||
| 53 | } |
||
| 55 |