Skip to content

Commit f64cea8

Browse files
committed
🚨 Apply workaround for cache-related issue in tests
1 parent 18402d6 commit f64cea8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/NoSecurityBundleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace TheCodingMachine\GraphQLite\Bundle\Tests;
44

5+
use Symfony\Component\Cache\Adapter\ApcuAdapter;
56
use function json_decode;
67
use PHPUnit\Framework\TestCase;
78
use Symfony\Component\HttpFoundation\Request;
@@ -15,6 +16,13 @@ class NoSecurityBundleTest extends TestCase
1516
{
1617
public function testServiceWiring(): void
1718
{
19+
// tech debt: for some reason when we're running full test suite
20+
// - from APCu cache we're getting old controllers for available graphql and this fails test
21+
if (ApcuAdapter::isSupported()) {
22+
$apcu = new ApcuAdapter();
23+
$apcu->clear();
24+
}
25+
1826
$kernel = new GraphQLiteTestingKernel(true, null, false, null, true, null, null, ['TheCodingMachine\\GraphQLite\\Bundle\\Tests\\NoSecurityBundleFixtures\\Controller\\']);
1927
$kernel->boot();
2028
$container = $kernel->getContainer();

0 commit comments

Comments
 (0)