public static createForValue ( Nelmio\Alice\Definition\ValueInterface $value ) : ResolverNotFoundException | ||
$value | Nelmio\Alice\Definition\ValueInterface | |
return | ResolverNotFoundException |
public function testTestCreateNewExceptionWithFactoryForValue() { $exception = ResolverNotFoundExceptionFactory::createForValue(new DummyValue('dummy')); $this->assertEquals('No resolver found to resolve value "dummy".', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }
/** * {@inheritdoc} * * @throws ResolverNotFoundException */ public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet { foreach ($this->resolvers as $resolver) { if ($resolver->canResolve($value)) { return $resolver->resolve($value, $fixture, $fixtureSet, $scope, $context); } } throw ResolverNotFoundExceptionFactory::createForValue($value); }