public static createForRedundantUniqueValue ( string $id ) : InvalidArgumentException | ||
$id | string | |
return | InvalidArgumentException |
public function testTestCreateForRedundantUniqueValue() { $exception = InvalidArgumentExceptionFactory::createForRedundantUniqueValue('foo'); $this->assertEquals('Cannot create a unique value of a unique value for value "foo".', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }
/** * @param string $id Unique across a fixture set, is used to generate unique values. * @param mixed $value */ public function __construct(string $id, $value) { $this->id = $id; if ($value instanceof self) { throw InvalidArgumentExceptionFactory::createForRedundantUniqueValue($id); } $this->value = deep_clone($value); }