Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/PhpUnit/BaseDatabaseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ protected static function ensureKernelTestCase(): void
protected static function populateDatabase(): void
{
$container = static::$kernel->getContainer();
$manager = $container->get('doctrine')->getManager(static::$manager);
static::$fixtures = $container->get('hautelook_alice.loader')->load(
new Application(static::$kernel), // OK this is ugly... But there is no other way without redesigning LoaderInterface from the ground.
$container->get('doctrine')->getManager(static::$manager),
$manager,
static::$bundles,
static::$kernel->getEnvironment(),
static::$append,
static::$purgeWithTruncate,
static::$shard
);
$manager->clear();
}
}
5 changes: 5 additions & 0 deletions tests/PhpUnit/RefreshTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
*/
trait RefreshTestTrait
{
public function testUnitOfWorkIsEmptyAtTheStartOfTheTest(): void
{
self::assertEquals(0, $this->getManager()->getUnitOfWork()->size());
}

public function testRefresh(): void
{
$manager = $this->getManager();
Expand Down