Nelmio\Alice\Generator\Instantiator\InstantiatorResolverTest::testDoesNotResolveArgumentsIfNoConstructorGiven PHP Method

testDoesNotResolveArgumentsIfNoConstructorGiven() public method

    public function testDoesNotResolveArgumentsIfNoConstructorGiven()
    {
        $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);
    }