Skip to content

Commit

Permalink
try to fix cache test
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Mar 1, 2024
1 parent 2d8d815 commit 6e14611
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
34 changes: 17 additions & 17 deletions .github/ci/files/bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@

ob_get_clean();

if (file_exists($a = getcwd() . '/vendor/autoload.php')) {
if (file_exists($a = getcwd() . '/vendor/autoload_runtime.php')) {
include $a;
} elseif (file_exists($a = __DIR__ . '/../../../../vendor/autoload.php')) {
} elseif (file_exists($a = __DIR__ . '/../../../../vendor/autoload_runtime.php')) {
include $a;
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) {
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload_runtime.php')) {
include $a;
} else {
fwrite(STDERR, 'Cannot locate autoloader; please run "composer install"' . PHP_EOL);
exit(1);
}

\Pimcore\Bootstrap::setProjectRoot();
return function (array $context) {
define('PIMCORE_CONSOLE', true);

define('PIMCORE_CONSOLE', true);
$input = new \Symfony\Component\Console\Input\ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

$input = new \Symfony\Component\Console\Input\ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
/** @var \Pimcore\Kernel $kernel */
$kernel = \Pimcore\Bootstrap::startupCli();
$application = new \Pimcore\Console\Application($kernel);
$application->run();
return $application;
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

/** @var \Pimcore\Kernel $kernel */
$kernel = \Pimcore\Bootstrap::startupCli();
$application = new \Pimcore\Console\Application($kernel);
$application->run();
1 change: 0 additions & 1 deletion tests/Service/OutputCacheServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ public function testIgnoreCacheWhenRequestParameterIsPassed()
$response = new JsonResponse(['data' => 123]);
$this->sut->method('loadFromCache')->willReturn($response);
$this->request->query->set('pimcore_nocache', 'true');
\Pimcore::inDebugMode(true);

// Act
$cacheItem = $this->sut->load($this->request);
Expand Down

0 comments on commit 6e14611

Please sign in to comment.