Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Jun 4, 2021
1 parent 9b30e25 commit 55dc3c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/sortable-behavior-bundle/tests/App/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
'test' => true,
'router' => ['utf8' => true],
'secret' => 'secret',
'form' => ['enabled' => true],
'property_access' => ['enabled' => true],
]);

$container->loadFromExtension('security', [
Expand Down
14 changes: 9 additions & 5 deletions packages/testing/src/TestCase/DoctrineTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@ private function ensureSchemaIsCreated(): void
return;
}

static::$entityManager = static::$container->get(EntityManagerInterface::class);
static::$loader = static::$container->get('fidry_alice_data_fixtures.loader.doctrine');
static::$connection = static::$container->get(Connection::class);
static::$containerBag = static::$container->get(ContainerBagInterface::class);
/* @phpstan-ignore-next-line */
$container = method_exists(static::class, 'getContainer') ? static::getContainer() : static::$container;

static::$container->get(RequestStack::class)->push(new Request());
static::$entityManager = $container->get(EntityManagerInterface::class);
static::$loader = $container->get('fidry_alice_data_fixtures.loader.doctrine');
static::$connection = $container->get(Connection::class);
static::$containerBag = $container->get(ContainerBagInterface::class);

$container->get(RequestStack::class)->push(new Request());

if (!class_exists(DatabaseResetter::class)) {
$schemaTool = new SchemaTool(static::$entityManager);
$schemaTool->dropDatabase();
$schemaTool->createSchema(static::$entityManager->getMetadataFactory()->getAllMetadata());
}

Expand Down
2 changes: 2 additions & 0 deletions packages/testing/tests/App/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
'test' => true,
'router' => ['utf8' => true],
'secret' => 'secret',
'annotations' => ['enabled' => true],
'property_access' => ['enabled' => true],
]);

$container->loadFromExtension('doctrine', [
Expand Down

0 comments on commit 55dc3c2

Please sign in to comment.