Issues (8)

tests/Unit/ViewTest.php (1 issue)

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
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\MockOb...ckBuilder::setMethods() has been deprecated: https://github.com/sebastianbergmann/phpunit/pull/3687 ( Ignorable by Annotation )

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

16
        $callback = /** @scrutinizer ignore-deprecated */ $this

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
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);
26
        $view->render();
27
    }
28
}
29