public static createForWhenResolvingParameter ( string $key, |
||
$key | string | |
$parameter | ||
Результат | ParameterNotFoundException |
public static function createForWhenResolvingParameter(string $key, Parameter $parameter) : ParameterNotFoundException
{
return new ParameterNotFoundException(sprintf('Could not find the parameter "%s" when resolving "%s".', $key, $parameter->getKey()));
}
public function testTestCreateForWhenResolvingParameter() { $exception = ParameterNotFoundExceptionFactory::createForWhenResolvingParameter('foo', new Parameter('bar', 'baz')); $this->assertEquals('Could not find the parameter "foo" when resolving "bar".', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }