Passed
Pull Request — master (#277)
by Kirill
03:11
created

InitTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Framework\Migrate;
13
14
use Spiral\Database\Database;
15
use Spiral\Tests\Framework\ConsoleTest;
16
17
class InitTest extends ConsoleTest
18
{
19
    public function setUp(): void
20
    {
21
        parent::setUp();
22
23
        $this->app->getEnvironment()->set('SAFE_MIGRATIONS', true);
24
    }
25
26
    public function testInit(): void
27
    {
28
        /** @var Database $db */
29
        $db = $this->app->get(Database::class);
30
31
        $this->assertSame([], $db->getTables());
32
33
        $this->runCommandDebug('migrate:init');
34
35
        $t = $db->getTables()[0];
36
        $this->assertSame('migrations', $t->getName());
37
    }
38
}
39