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

createForConstructorIsMissingMandatoryParameters() public static method

public static createForConstructorIsMissingMandatoryParameters ( Nelmio\Alice\FixtureInterface $fixture ) : InstantiationException
$fixture Nelmio\Alice\FixtureInterface
return InstantiationException
    public static function createForConstructorIsMissingMandatoryParameters(FixtureInterface $fixture) : InstantiationException
    {
        return new InstantiationException(sprintf('Could not instantiate "%s", the constructor has mandatory parameters but no parameters has been given.', $fixture->getId()));
    }

Usage Example

 public function testTestCreateForConstructorIsMissingMandatoryParameters()
 {
     $exception = InstantiationExceptionFactory::createForConstructorIsMissingMandatoryParameters(new DummyFixture('foo'));
     $this->assertEquals('Could not instantiate "foo", the constructor has mandatory parameters but no parameters has been given.', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\Generator\Instantiator\InstantiationExceptionFactory::createForConstructorIsMissingMandatoryParameters