Skip to content

Commit

Permalink
OXDEV-7248 Remve facts usage
Browse files Browse the repository at this point in the history
  • Loading branch information
hkreuter committed Feb 12, 2025
1 parent 65c7b17 commit 29f3936
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
7 changes: 3 additions & 4 deletions tests/Integration/EnterpriseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@

namespace OxidEsales\GraphQL\Base\Tests\Integration;

use OxidEsales\Facts\Facts;
use OxidEsales\EshopCommunity\Internal\Framework\Edition\Edition;
use OxidEsales\EshopCommunity\Internal\Framework\Edition\EditionDirectoriesLocator;

abstract class EnterpriseTestCase extends TokenTestCase
{
public function setUp(): void
{
$facts = new Facts();

if ($facts->getEdition() !== 'EE') {
if (!(new EditionDirectoriesLocator())->getEditionRootPath(Edition::Enterprise)) {
$this->markTestSkipped('Skip EE related tests for CE/PE edition');
return;
}
Expand Down
32 changes: 18 additions & 14 deletions tests/Integration/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
use DateTimeImmutable;
use Lcobucci\JWT\UnencryptedToken;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface;
use OxidEsales\EshopCommunity\Core\Di\ContainerFacade;
use OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionFactoryInterface;
use OxidEsales\EshopCommunity\Tests\Integration\IntegrationTestCase;
use OxidEsales\EshopCommunity\Tests\TestContainerFactory;
use OxidEsales\Facts\Facts;
use OxidEsales\GraphQL\Base\DataType\UserInterface;
use OxidEsales\GraphQL\Base\Framework\GraphQLQueryHandler;
use OxidEsales\GraphQL\Base\Framework\RequestReader;
Expand Down Expand Up @@ -46,23 +46,20 @@ public function setUp(): void
{
parent::setUp();

$connection = ContainerFactory::getInstance()
->getContainer()
->get(QueryBuilderFactoryInterface::class)
ContainerFacade::get(ConnectionFactoryInterface::class)
->create()
->getConnection();

$connection->executeStatement(
file_get_contents(
__DIR__ . '/../Fixtures/dump.sql'
)
);
->executeStatement(
file_get_contents(
__DIR__ . '/../Fixtures/dump.sql'
)
);

\OxidEsales\Eshop\Core\Registry::getLang()->resetBaseLanguage();

if (static::$container !== null) {
return;
}

$containerFactory = new TestContainerFactory();
static::$container = $containerFactory->create();

Expand Down Expand Up @@ -97,6 +94,14 @@ public function setUp(): void
'oxidesales.graphqlbase.cacheadapter',
$cache
);
static::$container->setParameter(
'oxid_esales.db.replicate',
false
);
static::$container->setParameter(
'oxid_esales.db.replicas',
[]
);

static::beforeContainerCompile();

Expand Down Expand Up @@ -194,8 +199,7 @@ protected function uploadFile(
$boundary = '-------------' . uniqid();
$postData = $this->buildFileUpload($boundary, $fields, $map, $files);

$facts = new Facts();
$ch = curl_init($facts->getShopUrl() . '/graphql?lang=0&shp=1');
$ch = curl_init(getenv('OXID_SHOP_BASE_URL') . '/graphql?lang=0&shp=1');

$headers = [
'Connection: keep-alive',
Expand Down

0 comments on commit 29f3936

Please sign in to comment.