Permalink
Browse files

GenericLoader now throws DomainException instead of RuntimeException.

  • Loading branch information...
1 parent 1792788 commit 3624e127af29ba8535cbf8cd7c06a96ab6bde52b @zyxist zyxist committed Jun 14, 2011
Showing with 5 additions and 5 deletions.
  1. +3 −3 src/Opl/Autoloader/GenericLoader.php
  2. +2 −2 tests/TestSuite/GenericLoaderTest.php
@@ -10,7 +10,7 @@
* and other contributors. See website for details.
*/
namespace Opl\Autoloader;
-use RuntimeException;
+use DomainException;
/**
* The generic class autoloader is a slightly enhanced version of the
@@ -77,7 +77,7 @@ public function addNamespace($namespace, $path = null, $extension = '.php')
{
if(isset($this->_namespaces[(string)$namespace]))
{
- throw new RuntimeException('The namespace '.$namespace.' is already added.');
+ throw new DomainException('The namespace '.$namespace.' is already added.');
}
if($path !== null)
{
@@ -114,7 +114,7 @@ public function removeNamespace($namespace)
{
if(!isset($this->_namespaces[(string)$namespace]))
{
- throw new RuntimeException('The namespace '.$namespace.' is not available.');
+ throw new DomainException('The namespace '.$namespace.' is not available.');
}
unset($this->_namespaces[(string)$namespace]);
unset($this->_extensions[(string)$namespace]);
@@ -112,7 +112,7 @@ public function testAddNamespaceSetsCustomPathAndExtension()
} // end testAddNamespaceSetsCustomPathAndExtension();
/**
- * @expectedException RuntimeException
+ * @expectedException DomainException
*/
public function testAddNamespaceThrowsExceptionWhenNamespaceExists()
{
@@ -146,7 +146,7 @@ public function testRemoveNamespace()
/**
* @depends testRemoveNamespace
- * @expectedException RuntimeException
+ * @expectedException DomainException
*/
public function testRemoveNamespaceThrowsExceptionWhenNamespaceDoesNotExist()
{

0 comments on commit 3624e12

Please sign in to comment.