Nelmio\Alice\Throwable\Exception\Generator\Instantiator\InstantiationExceptionFactory::createForCouldNotGetConstructorData PHP Method

createForCouldNotGetConstructorData() public static method

public static createForCouldNotGetConstructorData ( Nelmio\Alice\FixtureInterface $fixture, integer $code, Throwable $previous = null ) : InstantiationException
$fixture Nelmio\Alice\FixtureInterface
$code integer
$previous Throwable
return InstantiationException
    public static function createForCouldNotGetConstructorData(FixtureInterface $fixture, int $code = 0, \Throwable $previous = null) : InstantiationException
    {
        return new InstantiationException(sprintf('Could not get the necessary data on the constructor to instantiate "%s".', $fixture->getId()), $code, $previous);
    }

Usage Example

 public function testTestCreateForCouldNotGetConstructorData()
 {
     $exception = InstantiationExceptionFactory::createForCouldNotGetConstructorData(new DummyFixture('foo'));
     $this->assertEquals('Could not get the necessary data on the constructor to instantiate "foo".', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\Generator\Instantiator\InstantiationExceptionFactory::createForCouldNotGetConstructorData