Skip to content

Commit

Permalink
Added core/application unit tests
Browse files Browse the repository at this point in the history
Updated module dependency management & loading

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
  • Loading branch information
gplanchat committed Sep 28, 2010
1 parent 5b74e9e commit 69d5565
Show file tree
Hide file tree
Showing 21 changed files with 426 additions and 275 deletions.
12 changes: 12 additions & 0 deletions .gitmodules
Expand Up @@ -7,3 +7,15 @@
[submodule "test/externals/libraries/php-file-iterator"]
path = test/externals/libraries/php-file-iterator
url = git://github.com/sebastianbergmann/php-file-iterator.git
[submodule "test/externals/libraries/php-token-stream"]
path = test/externals/libraries/php-token-stream
url = git://github.com/sebastianbergmann/php-token-stream.git
[submodule "test/externals/libraries/phpunit-mock-objects"]
path = test/externals/libraries/phpunit-mock-objects
url = git://github.com/sebastianbergmann/phpunit-mock-objects.git
[submodule "test/externals/libraries/php-text-template"]
path = test/externals/libraries/php-text-template
url = git://github.com/sebastianbergmann/php-text-template.git
[submodule "test/externals/libraries/php-timer"]
path = test/externals/libraries/php-timer
url = git://github.com/sebastianbergmann/php-timer.git
8 changes: 3 additions & 5 deletions application/One.php
Expand Up @@ -203,7 +203,6 @@ public static function app()
$modulePath = sprintf($pathPattern, $moduleConfig['codePool'], str_replace('_', DS, $moduleName));
self::_registerModule(self::getFrontController(), self::getRouter(), $moduleName, $moduleConfig, $modulePath);
}
var_dump(self::getFrontController()->getControllerDirectory());

self::getFrontController()->setDefaultModule('One_Core');
$dispatcher = self::getFrontController()->getDispatcher();
Expand Down Expand Up @@ -294,15 +293,14 @@ private static function _inflectClassName($className, $domain)
$inflector = new One_Core_Model_Inflector();
}

$domain = str_replace('.', '/', $domain);

$offset = strpos($className, '/');
$module = substr($className, 0, $offset);
$class = substr($className, $offset + 1);

self::getConfig("{$domain}/{$module}/rewrite")
// self::getConfig("{$domain}/{$module}/rewrite")

if (($namespace = self::getConfig("{$domain}/{$module}/namespace")) !== null) {
$xmlDomain = str_replace('.', '/', $domain);
if (($namespace = self::getConfig("{$xmlDomain}/{$module}/namespace")) !== null) {
return $namespace . '_' . $inflector->filter($class);
}

Expand Down
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Invalid method call exception, thrown when :
* - a configuration parameter is missing
Expand Down
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Invalid method call exception, thrown when :
* - conneciton to the database could not be set up
Expand Down
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Invalid method call exception, thrown when :
* - supplied conneciton name could not be found by the conneciton pool
Expand Down
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Invalid method call exception, thrown when :
* - Desired database resource is not found
Expand Down
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Invalid implementation, thrown when :
* - a class instanciated by Nova object forgeries does not implement the
Expand Down
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Invalid method call exception, thrown when :
* - at least one constructor param is missing or is invalid
Expand Down
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Invalid method call exception, thrown when :
* - an inexistent method is called
Expand Down
1 change: 0 additions & 1 deletion application/code/core/One/Core/Exception/Unimplemented.php
Expand Up @@ -28,7 +28,6 @@
*
*/

require_once 'Nova/Core/Exception.php';
/**
* Unimplemented method/function/algorithm exception, thrown when :
* - desired functionality isn't yet impelmented
Expand Down

0 comments on commit 69d5565

Please sign in to comment.