Permalink
Browse files

convert all vendor and package namespace names to use initial upper-c…

…ase letter
  • Loading branch information...
1 parent 70f992e commit fe85b4afc022cc8bf01b0d7b1f6ced67b9e57a10 @pmjones pmjones committed Jun 13, 2011
View
2 scripts/instance.php
@@ -1,4 +1,4 @@
<?php
-namespace aura\autoload;
+namespace Aura\Autoload;
require_once dirname(__DIR__) . '/src.php';
return new Loader;
View
2 src/Exception.php
@@ -6,7 +6,7 @@
* @license http://opensource.org/licenses/bsd-license.php BSD
*
*/
-namespace aura\autoload;
+namespace Aura\Autoload;
/**
*
View
4 src/Exception/AlreadyLoaded.php
@@ -6,7 +6,7 @@
* @license http://opensource.org/licenses/bsd-license.php BSD
*
*/
-namespace aura\autoload;
+namespace Aura\Autoload\Exception;
/**
*
@@ -15,4 +15,4 @@
* @package aura.autoload
*
*/
-class Exception_AlreadyLoaded extends Exception {}
+class AlreadyLoaded extends \Aura\Autoload\Exception {}
View
4 src/Exception/NotFound.php
@@ -6,7 +6,7 @@
* @license http://opensource.org/licenses/bsd-license.php BSD
*
*/
-namespace aura\autoload;
+namespace Aura\Autoload\Exception;
/**
*
@@ -15,4 +15,4 @@
* @package aura.autoload
*
*/
-class Exception_NotFound extends Exception {}
+class NotFound extends \Aura\Autoload\Exception {}
View
10 src/Loader.php
@@ -6,7 +6,7 @@
* @license http://opensource.org/licenses/bsd-license.php BSD
*
*/
-namespace aura\autoload;
+namespace Aura\Autoload;
/**
*
@@ -74,7 +74,7 @@ public function register()
*
* Adds a directory path for a class name prefix.
*
- * @param string $name The class name prefix, e.g. 'aura\framework\\' or
+ * @param string $name The class name prefix, e.g. 'Aura\Framework\\' or
* 'Zend_'.
*
* @param string $path The absolute path leading to the classes for that
@@ -150,19 +150,19 @@ public function getLoaded()
*
* @return void
*
- * @throws Exception_NotFound when the file for the class or
+ * @throws Exception\NotFound when the file for the class or
* interface is not found.
*
*/
public function load($class)
{
if (class_exists($class, false)) {
- throw new Exception_AlreadyLoaded($class);
+ throw new Exception\AlreadyLoaded($class);
}
$file = $this->find($class);
if (! $file) {
- throw new Exception_NotFound($class);
+ throw new Exception\NotFound($class);
}
require $file;
$this->loaded[$class] = $file;
View
34 tests/LoaderTest.php
@@ -1,5 +1,5 @@
<?php
-namespace aura\autoload;
+namespace Aura\Autoload;
/**
* Test class for Loader.
@@ -14,17 +14,17 @@ public function testRegister()
$autoloader->register();
$functions = spl_autoload_functions();
list($object, $method) = array_pop($functions);
- $this->assertType('aura\autoload\Loader', $object);
+ $this->assertType('Aura\Autoload\Loader', $object);
$this->assertSame('load', $method);
}
/**
*/
public function testLoadAndLoaded()
{
- $class = 'aura\autoload\MockAutoloadClass';
+ $class = 'Aura\Autoload\MockAutoloadClass';
$autoloader = new Loader;
- $autoloader->addPrefix('aura\autoload\\', __DIR__);
+ $autoloader->addPrefix('Aura\Autoload\\', __DIR__);
$autoloader->load($class);
$classes = get_declared_classes();
@@ -41,27 +41,27 @@ public function testLoadAndLoaded()
public function testLoadAlreadyLoaded()
{
- $class = 'aura\autoload\MockAutoloadAlready';
+ $class = 'Aura\Autoload\MockAutoloadAlready';
$autoloader = new Loader;
- $autoloader->addPrefix('aura\autoload\\', __DIR__);
+ $autoloader->addPrefix('Aura\Autoload\\', __DIR__);
$autoloader->load($class);
- $this->setExpectedException('aura\autoload\Exception_AlreadyLoaded');
+ $this->setExpectedException('Aura\Autoload\Exception\AlreadyLoaded');
$autoloader->load($class);
}
/**
- * @expectedException \aura\autoload\Exception_NotFound
+ * @expectedException \Aura\Autoload\Exception\NotFound
*/
public function testLoadMissing()
{
$autoloader = new Loader;
- $autoloader->addPrefix('aura\autoload\\', __DIR__);
- $autoloader->load('aura\autoload\NoSuchClass');
+ $autoloader->addPrefix('Aura\Autoload\\', __DIR__);
+ $autoloader->load('Aura\Autoload\NoSuchClass');
}
/**
- * @expectedException \aura\autoload\Exception_NotFound
+ * @expectedException \Aura\Autoload\Exception\NotFound
*/
public function testLoadNotInIncludePath()
{
@@ -91,7 +91,7 @@ public function testLoadClassWithoutNamespace()
// set an autoloader with paths
$autoloader = new Loader;
- $autoloader->addPrefix('aura\autoload\\', __DIR__);
+ $autoloader->addPrefix('Aura\Autoload\\', __DIR__);
// autoload it
$expect = 'ClassWithoutNamespace';
@@ -180,9 +180,9 @@ public function testClassToFile()
public function testFindDir()
{
$autoloader = new Loader;
- $autoloader->addPrefix('aura\autoload\\', __DIR__);
+ $autoloader->addPrefix('Aura\Autoload\\', __DIR__);
- $spec = 'aura\autoload';
+ $spec = 'Aura\Autoload';
$actual = $autoloader->findDir($spec);
$expect = array(__DIR__ . DIRECTORY_SEPARATOR);
$this->assertSame($expect, $actual);
@@ -191,9 +191,9 @@ public function testFindDir()
public function testFindDirContainingClass()
{
$autoloader = new Loader;
- $autoloader->addPrefix('aura\autoload\\', __DIR__);
+ $autoloader->addPrefix('Aura\Autoload\\', __DIR__);
- $spec = 'aura\autoload\MockAutoloadClass';
+ $spec = 'Aura\Autoload\MockAutoloadClass';
$actual = $autoloader->findDir($spec);
$expect = array(__DIR__);
$this->assertSame($expect, $actual);
@@ -206,7 +206,7 @@ public function testFindDirContainingClass()
public function testFindDirDoesNotExist()
{
$autoloader = new Loader;
- $autoloader->addPrefix('aura\autoload\\', __DIR__);
+ $autoloader->addPrefix('Aura\Autoload\\', __DIR__);
$spec = 'aura\nonesuch';
$actual = $autoloader->findDir($spec);
View
2 tests/MockAutoloadAlready.php
@@ -1,5 +1,5 @@
<?php
-namespace aura\autoload;
+namespace Aura\Autoload;
class MockAutoloadAlready extends MockAutoloadClass {
}
View
2 tests/MockAutoloadChild.php
@@ -1,5 +1,5 @@
<?php
-namespace aura\autoload;
+namespace Aura\Autoload;
class MockAutoloadChild extends MockAutoloadClass {
}
View
2 tests/MockAutoloadClass.php
@@ -1,3 +1,3 @@
<?php
-namespace aura\autoload;
+namespace Aura\Autoload;
class MockAutoloadClass {}

0 comments on commit fe85b4a

Please sign in to comment.