/** * @param Behat\Gherkin\Gherkin $gherkin * @param Behat\Gherkin\Node\FeatureNode $feature1 * @param Behat\Gherkin\Node\FeatureNode $feature2 * @param Behat\Gherkin\Node\ScenarioNode $scenario1 * @param Behat\Gherkin\Node\ScenarioNode $scenario2 * @param Behat\Gherkin\Node\ScenarioNode $scenario3 **/ function let($gherkin, $feature1, $feature2, $scenario1, $scenario2, $scenario3) { $this->beConstructedWith($gherkin, 'paths'); $gherkin->load('paths')->willReturn([$feature1, $feature2]); $feature1->getScenarios()->willReturn([$scenario1, $scenario3]); $feature2->getScenarios()->willReturn([$scenario2]); $scenario1->getTitle()->willReturn('Scenario1'); $scenario2->getTitle()->willReturn('Scenario2'); $scenario3->getTitle()->willReturn('Scenario3'); }
/** * @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); }