Passed
Push — master ( 240c83...03f39b )
by Mathias
06:41
created

MigrationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 13
dl 0
loc 22
rs 10
c 1
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
A testCreate() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yawik\Migration\Tests\Entity;
6
7
use Yawik\Migration\Entity\Migration;
8
use CoreTestUtils\TestCase\FunctionalTestCase;
0 ignored issues
show
Bug introduced by
The type CoreTestUtils\TestCase\FunctionalTestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Yawik\Migration\Tests\TestMigrator;
10
11
/**
12
 * @covers \Yawik\Migration\Entity\Migration
13
 */
14
class MigrationTest extends FunctionalTestCase
15
{
16
    private function create()
17
    {
18
        return new Migration(
19
            TestMigrator::class,
20
            'version',
21
            'test',
22
        );
23
    }
24
25
    public function testCreate()
26
    {
27
        $migration = $this->create();
28
        $this->assertEquals(TestMigrator::class, $migration->getClass());
29
        $this->assertEquals('version', $migration->getVersion());
30
        $this->assertEquals('test', $migration->getDescription());
31
        $this->assertNull($migration->getMigratedAt());
32
        $this->assertFalse($migration->isMigrated());
33
34
        $migration->setMigrated(true);
35
        $this->assertTrue($migration->isMigrated());
36
    }
37
}