Passed
Pull Request — master (#19)
by Victor
03:13
created

ViewTest::testShouldNotAllowEmptyNames()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 10
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoot\Shoot\Tests\Unit;
5
6
use PHPUnit\Framework\MockObject\MockObject;
7
use PHPUnit\Framework\TestCase;
8
use Shoot\Shoot\Tests\Fixtures\ViewFactory;
9
use stdClass;
10
11
final class ViewTest extends TestCase
12
{
13
    public function testShouldExecuteCallback(): void
14
    {
15
        /** @var callable|MockObject $callback */
16
        $callback = $this
17
            ->getMockBuilder(stdClass::class)
18
            ->setMethods(['__invoke'])
19
            ->getMock();
20
21
        $callback
22
            ->expects($this->once())
23
            ->method('__invoke');
24
25
        $view = ViewFactory::createWithCallback($callback);
0 ignored issues
show
Bug introduced by
$callback of type PHPUnit\Framework\MockObject\MockObject is incompatible with the type callable expected by parameter $callback of Shoot\Shoot\Tests\Fixtur...y::createWithCallback(). ( Ignorable by Annotation )

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

25
        $view = ViewFactory::createWithCallback(/** @scrutinizer ignore-type */ $callback);
Loading history...
26
        $view->render();
27
    }
28
}
29