instantiate() публичный Метод

public instantiate ( Nelmio\Alice\FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, GenerationContext $context ) : ResolvedFixtureSet
$fixture Nelmio\Alice\FixtureInterface
$fixtureSet Nelmio\Alice\Generator\ResolvedFixtureSet
$context Nelmio\Alice\Generator\GenerationContext
Результат Nelmio\Alice\Generator\ResolvedFixtureSet
Пример #1
0
 public function testDoesNotResolveArgumentsIfSpecifiedNoConstructor()
 {
     $specs = SpecificationBagFactory::create();
     $fixture = new SimpleFixture('dummy', 'stdClass', $specs);
     $set = ResolvedFixtureSetFactory::create();
     $context = new GenerationContext();
     $context->markIsResolvingFixture('foo');
     $expected = ResolvedFixtureSetFactory::create(null, (new FixtureBag())->with($fixture), new ObjectBag(['dummy' => new \stdClass()]));
     $resolverProphecy = $this->prophesize(ValueResolverInterface::class);
     $resolverProphecy->resolve(Argument::cetera())->shouldNotBeCalled();
     /** @var ValueResolverInterface $resolver */
     $resolver = $resolverProphecy->reveal();
     $decoratedInstantiatorProphecy = $this->prophesize(InstantiatorInterface::class);
     $decoratedInstantiatorProphecy->instantiate($fixture, $set, $context)->willReturn($expected);
     /** @var InstantiatorInterface $decoratedInstantiator */
     $decoratedInstantiator = $decoratedInstantiatorProphecy->reveal();
     $instantiator = new InstantiatorResolver($decoratedInstantiator, $resolver);
     $actual = $instantiator->instantiate($fixture, $set, $context);
     $this->assertSame($expected, $actual);
 }