public static createForRedundantUniqueValue ( string $id ) : InvalidArgumentException | ||
$id | string | |
리턴 | InvalidArgumentException |
public static function createForRedundantUniqueValue(string $id) : \InvalidArgumentException
{
return new \InvalidArgumentException(sprintf('Cannot create a unique value of a unique value for value "%s".', $id));
}
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()); }