1212use DateTimeImmutable ;
1313use Lcobucci \JWT \UnencryptedToken ;
1414use OxidEsales \EshopCommunity \Internal \Container \ContainerFactory ;
15- use OxidEsales \EshopCommunity \Internal \ Framework \ Database \ QueryBuilderFactoryInterface ;
16- use OxidEsales \EshopCommunity \Tests \ Integration \ IntegrationTestCase ;
15+ use OxidEsales \EshopCommunity \Core \ Di \ ContainerFacade ;
16+ use OxidEsales \EshopCommunity \Internal \ Framework \ Database \ ConnectionFactoryInterface ;
1717use OxidEsales \EshopCommunity \Tests \TestContainerFactory ;
1818use OxidEsales \Facts \Facts ;
1919use OxidEsales \GraphQL \Base \DataType \UserInterface ;
3030use Psr \Log \LoggerInterface ;
3131use ReflectionClass ;
3232use Symfony \Component \DependencyInjection \ContainerBuilder ;
33+ use PHPUnit \Framework \TestCase as FrameworkTestCase ;
3334
34- abstract class TestCase extends IntegrationTestCase
35+
36+ abstract class TestCase extends FrameworkTestCase
3537{
3638 protected static $ queryResult ;
3739
@@ -42,17 +44,13 @@ abstract class TestCase extends IntegrationTestCase
4244
4345 protected static $ query ;
4446
45- public function setUp (): void
47+ protected function setUp (): void
4648 {
4749 parent ::setUp ();
4850
49- $ connection = ContainerFactory::getInstance ()
50- ->getContainer ()
51- ->get (QueryBuilderFactoryInterface::class)
51+ ContainerFacade::get (ConnectionFactoryInterface::class)
5252 ->create ()
53- ->getConnection ();
54-
55- $ connection ->executeStatement (
53+ ->executeStatement (
5654 file_get_contents (
5755 __DIR__ . '/../Fixtures/dump.sql '
5856 )
@@ -63,6 +61,9 @@ public function setUp(): void
6361 if (static ::$ container !== null ) {
6462 return ;
6563 }
64+
65+ # ContainerFactory::resetContainer();
66+
6667 $ containerFactory = new TestContainerFactory ();
6768 static ::$ container = $ containerFactory ->create ();
6869
@@ -97,13 +98,21 @@ public function setUp(): void
9798 'oxidesales.graphqlbase.cacheadapter ' ,
9899 $ cache
99100 );
101+ static ::$ container ->setParameter (
102+ 'oxid_esales.db.replicate ' ,
103+ false
104+ );
105+ static ::$ container ->setParameter (
106+ 'oxid_esales.db.replicas ' ,
107+ []
108+ );
100109
101110 static ::beforeContainerCompile ();
102111
103112 static ::$ container ->compile ();
104113 }
105114
106- public function tearDown (): void
115+ protected function tearDown (): void
107116 {
108117 parent ::tearDown ();
109118 static ::$ queryResult = null ;
@@ -116,6 +125,8 @@ public function tearDown(): void
116125 }
117126 unset($ _SERVER ['HTTP_AUTHORIZATION ' ]);
118127 }
128+
129+ # ContainerFactory::resetContainer();
119130 }
120131
121132 protected function setAuthToken (string $ token ): void
0 commit comments