Skip to content

Commit

Permalink
Fixed TokenServiceTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ciastektk committed Apr 4, 2023
1 parent 61e4f31 commit 4e5d793
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/contracts/Test/IbexaTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class IbexaTestKernel extends Kernel
Repository\SearchService::class,
Repository\SectionService::class,
Repository\UserService::class,
Repository\TokenService::class,
];

/**
Expand Down
19 changes: 6 additions & 13 deletions tests/integration/Core/Repository/TokenServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,7 +27,10 @@ protected function setUp(): void
{
parent::setUp();

$this->tokenService = $this->getTokenService();
self::loadSchema();
self::loadFixtures();

$this->tokenService = self::getServiceByClassName(TokenService::class);
}

/**
Expand Down Expand Up @@ -190,15 +194,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);
}
}

0 comments on commit 4e5d793

Please sign in to comment.