Skip to content

Commit

Permalink
Soothe phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed May 14, 2024
1 parent 2ac1fef commit bbe1af6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/DonutRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
namespace BEAR\QueryRepository;

use BEAR\Resource\AbstractRequest;
use BEAR\Resource\Resource;
use BEAR\Resource\ResourceInterface;
use BEAR\Resource\Uri;
use Madapaja\TwigModule\TwigModule;
use PHPUnit\Framework\TestCase;
use Ray\Di\Injector;

use function assert;
use function dirname;

class DonutRequestTest extends TestCase
{
private AbstractRequest $request;
private ResourceInterface $resource;

protected function setUp(): void
{
Expand All @@ -25,9 +26,10 @@ protected function setUp(): void
$path = dirname(__DIR__) . '/tests/Fake/fake-app/var/templates';
$module->override(new TwigModule([$path]));
$injector = new Injector($module, $_ENV['TMP_DIR']);
$this->resource = $injector->getInstance(ResourceInterface::class);
/** @var AbstractRequest $request */
$request = $this->resource->get->uri('page://self/html/comment');
/** @var Resource $resource */
$resource = $injector->getInstance(ResourceInterface::class);
$request = $resource->get->uri('page://self/html/comment');
assert($request instanceof AbstractRequest);
$this->request = $request;

parent::setUp();
Expand Down

0 comments on commit bbe1af6

Please sign in to comment.