diff --git a/tests/DonutRequestTest.php b/tests/DonutRequestTest.php index 6386934c..547fb9bc 100644 --- a/tests/DonutRequestTest.php +++ b/tests/DonutRequestTest.php @@ -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 { @@ -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();