mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-24 18:13:00 +01:00
Fixing typo and fixing type tests
This commit is contained in:
parent
0c51598851
commit
023662e5c2
@ -21,8 +21,8 @@ abstract class AbstractType extends AbstractConstraint
|
||||
$type = (string) $options['type'];
|
||||
|
||||
if (!isset(static::$typeMapping[$type])) {
|
||||
throw new InvalidArgumentException("{$type} is not one "
|
||||
. 'the mapped types: ' . array_keys(self::$typeMapping));
|
||||
throw new InvalidArgumentException("{$type} is not one of the "
|
||||
. 'mapped types: ' . array_keys(self::$typeMapping));
|
||||
}
|
||||
|
||||
$method = static::$typeMapping[$type];
|
||||
|
@ -17,7 +17,7 @@ class CtypeTest extends Validation
|
||||
array($c, 'a', array('alpha'), true, null),
|
||||
array($c, '2', array('type' => 'alpha'), 'Value must be of type alpha', null),
|
||||
array($c, ' ', array('type' => 'space'), true, null),
|
||||
array($c, 'a', array('foo'), null, 'Guzzle\Common\Exception\InvalidArgumentException')
|
||||
array($c, 'a', array('type' => 'foo'), null, 'Guzzle\Common\Exception\InvalidArgumentException')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,9 @@ class Validation extends \Guzzle\Tests\GuzzleTestCase
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$this->assertInstanceOf($exception, $e);
|
||||
if (!($e instanceof $exception)) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user