diff --git a/tests/Integration/EnterpriseTestCase.php b/tests/Integration/EnterpriseTestCase.php index a57c6f99..e80975c7 100644 --- a/tests/Integration/EnterpriseTestCase.php +++ b/tests/Integration/EnterpriseTestCase.php @@ -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; } diff --git a/tests/Integration/TestCase.php b/tests/Integration/TestCase.php index 772ac35a..fec05adc 100644 --- a/tests/Integration/TestCase.php +++ b/tests/Integration/TestCase.php @@ -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; @@ -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(); @@ -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(); @@ -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',