From fa479691151a56c6f8877eb81cd289d3b7068329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fre=CC=81de=CC=81ric=20Hardy?= Date: Fri, 7 Dec 2012 10:49:27 +0100 Subject: [PATCH] Several optimization to improve performance and to add autorun support Define __DIR__ if not exists and use it everywhere in the file instead of dirname(__FILE__). Remove call to Finder and use sfAutloader::register() instead to use autoload cache. Include atoum/scripts/runner.php instead of atoum/classes/autoloader.php to be able to do ` php path/to/test/file.php` to execute test. --- bootstrap/unit.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/bootstrap/unit.php b/bootstrap/unit.php index d9da7e5..78a959a 100644 --- a/bootstrap/unit.php +++ b/bootstrap/unit.php @@ -1,30 +1,27 @@ loadConfiguration(sfFinder::type('file')->name('autoload.yml')->in(array( - sfConfig::get('sf_symfony_lib_dir').'/config/config', - sfConfig::get('sf_config_dir'), -))); -$autoload->register(); +sfAutoload::register(); if (defined('\mageekguy\atoum\running') === false) { if (null === $atoumPath = sfConfig::get('sf_atoum_path')) { - $atoumPath = dirname(__FILE__) . '/../../../lib/vendor/atoum/'; + $atoumPath = __DIR__.'/../../../lib/vendor/atoum/'; } - require_once $atoumPath . '/classes/autoloader.php'; -} -if (defined('mageekguy\atoum\autorun') === false) -{ - define('mageekguy\atoum\autorun', true); + require_once $atoumPath.'/scripts/runner.php'; } -