From 023662e5c2ecd94b133978e99b8c61eb6c12be02 Mon Sep 17 00:00:00 2001 From: Michael Dowling Date: Sun, 6 May 2012 23:24:02 -0700 Subject: [PATCH] Fixing typo and fixing type tests --- src/Guzzle/Common/Validation/AbstractType.php | 4 ++-- tests/Guzzle/Tests/Common/Validation/CtypeTest.php | 2 +- tests/Guzzle/Tests/Common/Validation/Validation.php | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Guzzle/Common/Validation/AbstractType.php b/src/Guzzle/Common/Validation/AbstractType.php index 63eaf898..cc15d4a6 100644 --- a/src/Guzzle/Common/Validation/AbstractType.php +++ b/src/Guzzle/Common/Validation/AbstractType.php @@ -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]; diff --git a/tests/Guzzle/Tests/Common/Validation/CtypeTest.php b/tests/Guzzle/Tests/Common/Validation/CtypeTest.php index 8f7447af..ab1bcf95 100644 --- a/tests/Guzzle/Tests/Common/Validation/CtypeTest.php +++ b/tests/Guzzle/Tests/Common/Validation/CtypeTest.php @@ -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') ); } } diff --git a/tests/Guzzle/Tests/Common/Validation/Validation.php b/tests/Guzzle/Tests/Common/Validation/Validation.php index 4b4cad78..f75811d7 100644 --- a/tests/Guzzle/Tests/Common/Validation/Validation.php +++ b/tests/Guzzle/Tests/Common/Validation/Validation.php @@ -18,7 +18,9 @@ class Validation extends \Guzzle\Tests\GuzzleTestCase throw $e; } - $this->assertInstanceOf($exception, $e); + if (!($e instanceof $exception)) { + throw $e; + } } } }