/**
  * @param Symfony\Component\DependencyInjection\ContainerInterface $container
  * @param Doctrine\Common\Persistence\ManagerRegistry $doctrine
  * @param Doctrine\Common\Persistence\ObjectManager $manager
  * @param Doctrine\ORM\EntityRepository $repository
  * @param Doctrine\ORM\QueryBuilder $queryBuilder
  * @param Doctrine\ORM\AbstractQuery $query
  * @param Knp\FriendlyContexts\Doctrine\EntityResolver $resolver
  * @param Knp\FriendlyContexts\Record\Collection\Bag $bag
  * @param Knp\FriendlyContexts\Record\Collection $collection
  * @param Knp\FriendlyContexts\Record\Record $record1
  * @param Knp\FriendlyContexts\Record\Record $record2
  * @param Knp\FriendlyContexts\Utils\Asserter $asserter
  * @param \ReflectionClass $reflectionClass
  **/
 function let($container, $doctrine, $manager, $repository, $queryBuilder, $query, $resolver, $bag, $collection, \ReflectionClass $reflectionClass, $asserter, $record1, $record2, $entity1, $entity2, $entity3)
 {
     $entity1 = 'e1';
     $entity2 = 'e2';
     $entity3 = 'e3';
     $doctrine->getManager()->willReturn($manager);
     $manager->getRepository(Argument::any())->willReturn($repository);
     $repository->createQueryBuilder(Argument::any())->willReturn($queryBuilder);
     $queryBuilder->getQuery()->willReturn($query);
     $queryBuilder->resetDQLParts()->willReturn($queryBuilder);
     $queryBuilder->select('o')->willReturn($queryBuilder);
     $queryBuilder->from(Argument::cetera())->willReturn($queryBuilder);
     $query->getResult()->willReturn([$entity1, $entity2, $entity3]);
     $resolver->resolve($manager, 'entities', Argument::cetera())->willReturn([$reflectionClass]);
     $bag->getCollection(Argument::any())->willReturn($collection);
     $collection->all()->willReturn([$record1, $record2]);
     $collection->attach(Argument::cetera())->willReturn(null);
     $record1->getEntity()->willReturn($entity1);
     $record2->getEntity()->willReturn($entity2);
     $container->has(Argument::any())->willReturn(true);
     $container->get('doctrine')->willReturn($doctrine);
     $container->get('friendly.entity.resolver')->willReturn($resolver);
     $container->get('friendly.entity.resolver')->willReturn($resolver);
     $container->get('friendly.record.bag')->willReturn($bag);
     $container->get('friendly.asserter')->willReturn(new Asserter(new TextFormater()));
     $container->hasParameter('friendly.entities.namespaces')->willReturn(true);
     $container->getParameter('friendly.entities.namespaces')->willReturn([]);
     $this->initialize([], $container);
 }
 /**
  * @param Symfony\Component\DependencyInjection\ContainerInterface $container
  * @param Doctrine\Common\Persistence\ManagerRegistry $doctrine
  * @param Doctrine\Common\Persistence\ObjectManager $manager
  * @param Behat\Behat\Hook\Scope\ScenarioScope $event
  * @param Behat\Gherkin\Node\FeatureNode $feature
  * @param Behat\Gherkin\Node\ScenarioNode $scenario
  * @param Knp\FriendlyContexts\Alice\Loader\Yaml $loader
  **/
 function let($container, $doctrine, $manager, $event, $loader, $feature, $scenario)
 {
     $doctrine->getManager()->willReturn($manager);
     $feature->getTags()->willReturn(['alice(Place)', 'admin']);
     $scenario->getTags()->willReturn(['alice(User)']);
     $event->getFeature()->willReturn($feature);
     $event->getScenario()->willReturn($scenario);
     $loader->load('user.yml')->willReturn([]);
     $loader->load('product.yml')->willReturn([]);
     $loader->load('place.yml')->willReturn([]);
     $loader->getCache()->willReturn([]);
     $loader->clearCache()->willReturn(null);
     $fixtures = ['User' => 'user.yml', 'Product' => 'product.yml', 'Place' => 'place.yml'];
     $config = ['alice' => ['fixtures' => $fixtures, 'dependencies' => []]];
     $container->has(Argument::any())->willReturn(true);
     $container->hasParameter(Argument::any())->willReturn(true);
     $container->get('friendly.alice.loader.yaml')->willReturn($loader);
     $container->get('doctrine')->willReturn($doctrine);
     $container->getParameter('friendly.alice.fixtures')->willReturn($fixtures);
     $container->getParameter('friendly.alice.dependencies')->willReturn([]);
     $this->initialize($config, $container);
 }