MigrationCreatorTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 12 1
1
<?php
2
3
4
namespace Quantick\DeployMigration\Tests\Lib\Service;
5
6
7
use Illuminate\Contracts\Filesystem\FileNotFoundException;
8
use Illuminate\Filesystem\Filesystem;
9
use PHPUnit\Framework\MockObject\MockObject;
10
use PHPUnit\Framework\TestCase;
11
use Quantick\DeployMigration\Lib\Service\Config;
12
use Quantick\DeployMigration\Lib\Service\MigrationCreator;
13
14
class MigrationCreatorTest extends TestCase
15
{
16
    /**
17
     * @throws FileNotFoundException
18
     */
19
    public function testCreate()
20
    {
21
        /** @var Filesystem|MockObject $filesystem */
22
        $filesystem = $this->createPartialMock(Filesystem::class, ['put']);
23
        $filesystem->expects(static::once())->method('put')->willReturn(true);
24
25
        $config = $this->createMock(Config::class);
26
        $config->method('getMigrationsPath')->willReturn('path');
27
        $creator = new MigrationCreator($filesystem, $config);
28
29
        $version = $creator->create();
30
        static::assertIsString($version);
31
    }
32
}