Completed
Push — master ( 4cf164...e90085 )
by Mike
02:35
created

test_providing_a_destination_to_render_to()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace phpDocumentor\Guides;
6
7
use League\Flysystem\FilesystemInterface;
8
use Mockery as m;
9
use Mockery\Adapter\Phpunit\MockeryTestCase;
10
11
final class RenderCommandTest extends MockeryTestCase
12
{
13
    public function test_providing_a_destination_to_render_to() : void
14
    {
15
        $destination = m::mock(FilesystemInterface::class);
16
17
        $command = new RenderCommand($destination);
0 ignored issues
show
Documentation introduced by
$destination is of type object<Mockery\LegacyMockInterface>, but the function expects a object<League\Flysystem\FilesystemInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
18
19
        self::assertSame($destination, $command->getDestination());
20
    }
21
}
22