public function test_get_repository_with_loader() { $container = new Container(); $om = new FakeObjectManager(); $loader = new DoctrineRepositoriesLoader($container, $om); $loader->enable(); $repository = $container->get(FakeRepository::class); $this->assertTrue($repository instanceof FakeRepository); $anotherRepository = $container->get(FakeRepository::class); $this->assertTrue($repository === $anotherRepository); }
/** * @param IContainer $container * @param EntityManager $em */ public function boot(IContainer $container, EntityManager $em) { $loader = new DoctrineRepositoriesLoader($container, $em); $loader->enable(); }