Exemplo n.º 1
0
 /**
  * @param Suite $suite
  * @param string $fixtureName
  * @param array $fixtureAttributes
  */
 private function addFixtureToSuite(Suite $suite, $fixtureName, array $fixtureAttributes)
 {
     Assert::keyExists($fixtureAttributes, 'options');
     $fixture = $this->fixtureRegistry->getFixture($fixtureName);
     $fixtureOptions = $this->optionsProcessor->processConfiguration($fixture, $fixtureAttributes['options']);
     $fixturePriority = isset($fixtureAttributes['priority']) ? $fixtureAttributes['priority'] : 0;
     $suite->addFixture($fixture, $fixtureOptions, $fixturePriority);
 }
Exemplo n.º 2
0
 function it_creates_a_new_suite_with_customized_fixture(FixtureRegistryInterface $fixtureRegistry, Processor $optionsProcessor, FixtureInterface $fixture)
 {
     $fixtureRegistry->getFixture('fixture')->willReturn($fixture);
     $optionsProcessor->processConfiguration($fixture, [['fixture_option' => 'fixture_value']])->willReturn(['fixture_option' => 'fixture_value']);
     $suite = $this->createSuite('suite_name', ['listeners' => [], 'fixtures' => ['fixture' => ['name' => 'fixture', 'options' => [['fixture_option' => 'fixture_value']]]]]);
     $suite->getName()->shouldReturn('suite_name');
     $suite->getFixtures()->shouldHaveKeyWithValue($fixture, ['fixture_option' => 'fixture_value']);
 }