/**
* @expectedException \Nelmio\Alice\Throwable\Exception\Generator\Instantiator\InstantiationException
* @expectedExceptionMessage Instantiated fixture was expected to be an instance of "Dummy". Got "Nelmio\Alice\Entity\Instantiator\DummyWithNamedConstructorAndOptionalParameters" instead.
*/
public function testThrowsAnExceptionIfFixtureClassDoesNotMatchObjectClass()
{
$fixture = new SimpleFixture('dummy', 'Dummy', SpecificationBagFactory::create(new MethodCallWithReference(new StaticReference(DummyWithNamedConstructorAndOptionalParameters::class), 'namedConstruct', [10])));
$set = $this->instantiator->instantiate($fixture, ResolvedFixtureSetFactory::create(), new GenerationContext());
$expected = DummyWithNamedConstructorAndOptionalParameters::namedConstruct(10);
$actual = $set->getObjects()->get($fixture)->getInstance();
$this->assertEquals($expected, $actual);
}