Skip to content

Commit

Permalink
Run with shop 8.0.x and facts spike
Browse files Browse the repository at this point in the history
  • Loading branch information
hkreuter committed Dec 18, 2024
1 parent 81a6ede commit fc90a14
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions tests/Integration/Infrastructure/TokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
use Lcobucci\JWT\Token\DataSet;
use Lcobucci\JWT\UnencryptedToken;
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\EshopCommunity\Tests\Integration\IntegrationTestCase;
use OxidEsales\EshopCommunity\Core\Di\ContainerFacade;
use OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionFactoryInterface;
use OxidEsales\EshopCommunity\Tests\TestContainerFactory;
use OxidEsales\GraphQL\Base\DataType\Token as TokenDataType;
use OxidEsales\GraphQL\Base\DataType\User as UserDataType;
use OxidEsales\GraphQL\Base\Infrastructure\Model\Token as TokenModel;
use OxidEsales\GraphQL\Base\Infrastructure\Token as TokenInfrastructure;
use OxidEsales\GraphQL\Base\Service\Token;
use OxidEsales\GraphQL\Base\Service\Token as TokenService;
use OxidEsales\EshopCommunity\Tests\ContainerTrait;
use PHPUnit\Framework\TestCase;

class TokenTest extends IntegrationTestCase
class TokenTest extends TestCase
{
private const TEST_TOKEN_ID = '_my_test_token';

Expand All @@ -31,7 +34,7 @@ class TokenTest extends IntegrationTestCase
/** @var TokenInfrastructure */
private $tokenInfrastructure;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();
$containerFactory = new TestContainerFactory();
Expand All @@ -50,6 +53,14 @@ public function setUp(): void
$this->tokenInfrastructure = $container->get(TokenInfrastructure::class);
}

protected function tearDown(): void
{
$this->cleanUp();

parent::tearDown();
}


public function testRegisterToken(): void
{
$this->tokenInfrastructure->registerToken(
Expand Down Expand Up @@ -389,4 +400,13 @@ private function getTokenMock(

return $token;
}

private function cleanUp(): void
{
ContainerFacade::get(ConnectionFactoryInterface::class)
->create()
->executeQuery(
'truncate table `oegraphqltoken`'
);
}
}

0 comments on commit fc90a14

Please sign in to comment.