Skip to content

Commit

Permalink
Adapt new configuration to enable access without HTTPS in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Mar 29, 2024
1 parent 8af3e00 commit 0bef336
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/Integration/ApiPlatform/ApiTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ abstract class ApiTestCase extends SymfonyApiTestCase
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::updateConfiguration('PS_ADMIN_API_FORCE_DEBUG_SECURED', 0);
ApiClientResetter::resetApiClient();
}

public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
ApiClientResetter::resetApiClient();
self::updateConfiguration('PS_ADMIN_API_FORCE_DEBUG_SECURED', 1);
self::$clientSecret = null;
}

Expand Down Expand Up @@ -258,5 +260,6 @@ protected static function addShop(string $shopName, int $shopGroupId, string $co
protected static function updateConfiguration(string $configurationKey, $value, ShopConstraint $shopConstraint = null): void
{
self::getContainer()->get(ShopConfigurationInterface::class)->set($configurationKey, $value, $shopConstraint ?: ShopConstraint::allShops());
\Configuration::resetStaticCache();
}
}
1 change: 0 additions & 1 deletion tests/Integration/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
define('_PS_ROOT_DIR_', dirname(__DIR__, 4));
}
define('_PS_IN_TEST_', true);
define('_PS_API_FORCE_TLS_VERSION_', false);
define('_PS_MODULE_DIR_', _PS_ROOT_DIR_ . '/tests/Resources/modules/');
require_once _PS_ROOT_DIR_ . '/vendor/smarty/smarty/libs/functions.php';
require_once _PS_ROOT_DIR_ . '/admin-dev/bootstrap.php';
Expand Down

0 comments on commit 0bef336

Please sign in to comment.