Nelmio\Alice\Generator\Instantiator\Chainable\NullConstructorInstantiatorTest::testThrowsAnExceptionIfReflectionFailsWithAnotherErrorThanMethodNotExisting PHP Method

testThrowsAnExceptionIfReflectionFailsWithAnotherErrorThanMethodNotExisting() public method

    public function testThrowsAnExceptionIfReflectionFailsWithAnotherErrorThanMethodNotExisting()
    {
        try {
            $fixture = new SimpleFixture('dummy', 'Unknown', SpecificationBagFactory::create());
            $this->instantiator->instantiate($fixture, ResolvedFixtureSetFactory::create(), new GenerationContext());
            $this->fail('Expected exception to be thrown.');
        } catch (InstantiationException $exception) {
            $this->assertEquals('Could not get the necessary data on the constructor to instantiate "dummy".', $exception->getMessage());
            $this->assertEquals(0, $exception->getCode());
            $this->assertNotNull($exception->getPrevious());
        }
    }