Permalink
Browse files

Changing the exceptions thrown by some methods in ClassMapLoader.

  • Loading branch information...
1 parent 74a8ac0 commit 23af49718d4ac0e002731f4464eb239cc69cae09 @zyxist zyxist committed Jun 14, 2011
Showing with 5 additions and 4 deletions.
  1. +3 −2 src/Opl/Autoloader/ClassMapLoader.php
  2. +2 −2 tests/TestSuite/ClassMapLoaderTest.php
@@ -10,6 +10,7 @@
* and other contributors. See website for details.
*/
namespace Opl\Autoloader;
+use DomainException;
use RuntimeException;
/**
@@ -85,7 +86,7 @@ public function addNamespace($namespace, $path = null)
{
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)
{
@@ -122,7 +123,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]);
} // end removeNamespace();
@@ -96,7 +96,7 @@ public function testAddNamespaceSetsCustomPath()
} // end testAddNamespaceSetsCustomPath();
/**
- * @expectedException RuntimeException
+ * @expectedException DomainException
*/
public function testAddNamespaceThrowsExceptionWhenNamespaceExists()
{
@@ -126,7 +126,7 @@ public function testRemoveNamespace()
/**
* @depends testRemoveNamespace
- * @expectedException RuntimeException
+ * @expectedException DomainException
*/
public function testRemoveNamespaceThrowsExceptionWhenNamespaceDoesNotExist()
{

0 comments on commit 23af497

Please sign in to comment.