createForInvalidFakerFormatter() public static method

public static createForInvalidFakerFormatter ( string $formatter ) : InvalidArgumentException
$formatter string
return InvalidArgumentException
コード例 #1
0
 private function getGenerator(GeneratorFactory $factory, string $formatter)
 {
     $explodedFormatter = explode(':', $formatter);
     $size = count($explodedFormatter);
     if (1 === $size) {
         return [$factory->getSeedGenerator(), $explodedFormatter[0]];
     }
     if (2 === $size) {
         return [$factory->createOrReturnExistingInstance($explodedFormatter[0]), $explodedFormatter[1]];
     }
     throw InvalidArgumentExceptionFactory::createForInvalidFakerFormatter($formatter);
 }
コード例 #2
0
 public function testTestCreateForInvalidFakerFormatter()
 {
     $exception = InvalidArgumentExceptionFactory::createForInvalidFakerFormatter('foo');
     $this->assertEquals('Invalid faker formatter "foo" found.', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }