Permalink
Browse files

Fix bad reference to exception class in ReadPreference

  • Loading branch information...
1 parent d1f897c commit b317c8e30e9510703fa3d2c2942c4e466d521b4a @jmikola jmikola committed Jan 10, 2013
@@ -60,7 +60,7 @@ private function __construct() {}
public static function convertNumericType($type)
{
if (!isset(self::$types[$type])) {
- throw new InvalidArgumentException('Unknown read preference type: ' . $type);
+ throw new \InvalidArgumentException('Unknown read preference type: ' . $type);
}
return self::$types[$type];
@@ -7,6 +7,14 @@
class ReadPreferenceTest extends \PHPUnit_Framework_TestCase
{
/**
+ * @expectedException InvalidArgumentException
+ */
+ public function testConvertNumericTypeShouldThrowExceptionForInvalidType()
+ {
+ ReadPreference::convertNumericType(-1);
+ }
+
+ /**
* @dataProvider provideTagSets
*/
public function testConvertTagSets($tagSet, $expected)

0 comments on commit b317c8e

Please sign in to comment.