Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bad reference to exception class in ReadPreference

  • Loading branch information...
commit b317c8e30e9510703fa3d2c2942c4e466d521b4a 1 parent d1f897c
@jmikola jmikola authored
View
2  lib/Doctrine/MongoDB/Util/ReadPreference.php
@@ -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];
View
8 tests/Doctrine/MongoDB/Tests/Util/ReadPreferenceTest.php
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.