Permalink
Browse files

Adding new unit test to UniversalLoaderTest.

  • Loading branch information...
1 parent 03f91cd commit ce3d3b617c78b705bb1b6b4bdd2f70a0805f17aa @zyxist zyxist committed Jun 14, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 tests/TestSuite/UniversalLoaderTest.php
@@ -114,6 +114,21 @@ public function testAddNamespaceSetsCustomPathAndExtension()
$this->assertEquals(array('Foo' => '.php5'), $extensionsProperty->getValue($loader));
} // end testAddNamespaceSetsCustomPathAndExtension();
+ public function testAddNamespaceAddsTrailingSlash()
+ {
+ $loader = new UniversalLoader('./foo/bar');
+ $loader->addNamespace('Foo', './bar/joe', '.php5');
+
+ $reflection = new \ReflectionObject($loader);
+ $namespacesProperty = $reflection->getProperty('namespaces');
+ $namespacesProperty->setAccessible(true);
+ $extensionsProperty = $reflection->getProperty('extensions');
+ $extensionsProperty->setAccessible(true);
+
+ $this->assertEquals(array('Foo' => './bar/joe/'), $namespacesProperty->getValue($loader));
+ $this->assertEquals(array('Foo' => '.php5'), $extensionsProperty->getValue($loader));
+ } // end testAddNamespaceAddsTrailingSlash();
+
/**
* @expectedException DomainException
*/

0 comments on commit ce3d3b6

Please sign in to comment.