Skip to content

Commit 29f3936

Browse files
committed
OXDEV-7248 Remve facts usage
1 parent 65c7b17 commit 29f3936

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

tests/Integration/EnterpriseTestCase.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99

1010
namespace OxidEsales\GraphQL\Base\Tests\Integration;
1111

12-
use OxidEsales\Facts\Facts;
12+
use OxidEsales\EshopCommunity\Internal\Framework\Edition\Edition;
13+
use OxidEsales\EshopCommunity\Internal\Framework\Edition\EditionDirectoriesLocator;
1314

1415
abstract class EnterpriseTestCase extends TokenTestCase
1516
{
1617
public function setUp(): void
1718
{
18-
$facts = new Facts();
19-
20-
if ($facts->getEdition() !== 'EE') {
19+
if (!(new EditionDirectoriesLocator())->getEditionRootPath(Edition::Enterprise)) {
2120
$this->markTestSkipped('Skip EE related tests for CE/PE edition');
2221
return;
2322
}

tests/Integration/TestCase.php

+18-14
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
use DateTimeImmutable;
1313
use Lcobucci\JWT\UnencryptedToken;
1414
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
15-
use OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface;
15+
use OxidEsales\EshopCommunity\Core\Di\ContainerFacade;
16+
use OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionFactoryInterface;
1617
use OxidEsales\EshopCommunity\Tests\Integration\IntegrationTestCase;
1718
use OxidEsales\EshopCommunity\Tests\TestContainerFactory;
18-
use OxidEsales\Facts\Facts;
1919
use OxidEsales\GraphQL\Base\DataType\UserInterface;
2020
use OxidEsales\GraphQL\Base\Framework\GraphQLQueryHandler;
2121
use OxidEsales\GraphQL\Base\Framework\RequestReader;
@@ -46,23 +46,20 @@ public function setUp(): void
4646
{
4747
parent::setUp();
4848

49-
$connection = ContainerFactory::getInstance()
50-
->getContainer()
51-
->get(QueryBuilderFactoryInterface::class)
49+
ContainerFacade::get(ConnectionFactoryInterface::class)
5250
->create()
53-
->getConnection();
54-
55-
$connection->executeStatement(
56-
file_get_contents(
57-
__DIR__ . '/../Fixtures/dump.sql'
58-
)
59-
);
51+
->executeStatement(
52+
file_get_contents(
53+
__DIR__ . '/../Fixtures/dump.sql'
54+
)
55+
);
6056

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

6359
if (static::$container !== null) {
6460
return;
6561
}
62+
6663
$containerFactory = new TestContainerFactory();
6764
static::$container = $containerFactory->create();
6865

@@ -97,6 +94,14 @@ public function setUp(): void
9794
'oxidesales.graphqlbase.cacheadapter',
9895
$cache
9996
);
97+
static::$container->setParameter(
98+
'oxid_esales.db.replicate',
99+
false
100+
);
101+
static::$container->setParameter(
102+
'oxid_esales.db.replicas',
103+
[]
104+
);
100105

101106
static::beforeContainerCompile();
102107

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

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

200204
$headers = [
201205
'Connection: keep-alive',

0 commit comments

Comments
 (0)