diff --git a/src/contracts/Test/IbexaTestKernel.php b/src/contracts/Test/IbexaTestKernel.php index a7ca42770a..ece393d629 100644 --- a/src/contracts/Test/IbexaTestKernel.php +++ b/src/contracts/Test/IbexaTestKernel.php @@ -88,6 +88,7 @@ class IbexaTestKernel extends Kernel Repository\SearchService::class, Repository\SectionService::class, Repository\UserService::class, + Repository\TokenService::class, ]; /** diff --git a/tests/integration/Core/Repository/TokenServiceTest.php b/tests/integration/Core/Repository/TokenServiceTest.php index 27ff04f199..9fefb45046 100644 --- a/tests/integration/Core/Repository/TokenServiceTest.php +++ b/tests/integration/Core/Repository/TokenServiceTest.php @@ -9,12 +9,13 @@ namespace Ibexa\Tests\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\TokenService; +use Ibexa\Contracts\Core\Test\IbexaKernelTestCase; use Ibexa\Core\Base\Exceptions\TokenLengthException; /** * @covers \Ibexa\Core\Repository\TokenService */ -final class TokenServiceTest extends BaseTest +final class TokenServiceTest extends IbexaKernelTestCase { private const TOKEN_TYPE = 'foo'; private const TOKEN_TTL = 100; @@ -26,7 +27,7 @@ protected function setUp(): void { parent::setUp(); - $this->tokenService = $this->getTokenService(); + $this->tokenService = self::getServiceByClassName(TokenService::class); } /** @@ -190,15 +191,4 @@ public function provideDataForTestCheckToken(): iterable null, ]; } - - /** - * @throws \ErrorException - */ - private function getTokenService(): TokenService - { - $container = $this->getSetupFactory()->getServiceContainer(); - - /** @var \Ibexa\Contracts\Core\Repository\TokenService */ - return $container->get(TokenService::class); - } }