Passed
Push — master ( ce3136...58f09e )
by Alexander
02:19
created

MigrationCreatorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

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');
0 ignored issues
show
Bug introduced by
The method method() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        $config->/** @scrutinizer ignore-call */ 
27
                 method('getMigrationsPath')->willReturn('path');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
27
        $creator = new MigrationCreator($filesystem, $config);
28
29
        $version = $creator->create();
30
        static::assertIsString($version);
31
    }
32
}