Permalink
Browse files

tweaked Twig dir definition for unit tests

  • Loading branch information...
1 parent 26bf47e commit 927dc5f4a857913687a5ae76e13b861840d855ee @fabpot fabpot committed Dec 15, 2010
Showing with 19 additions and 18 deletions.
  1. +14 −13 phpunit.xml.dist
  2. +1 −1 test/Twig/Tests/Node/DebugTest.php
  3. +4 −4 test/bootstrap.php
View
@@ -11,19 +11,20 @@
syntaxCheck="false"
bootstrap="test/bootstrap.php"
>
- <testsuites>
- <testsuite name="Twig Extensions Test Suite">
- <directory>./test/Twig/</directory>
- </testsuite>
- </testsuites>
+ <testsuites>
+ <testsuite name="Twig Extensions Test Suite">
+ <directory>./test/Twig/</directory>
+ </testsuite>
+ </testsuites>
- <filter>
- <whitelist>
- <directory suffix=".php">./lib/Twig/</directory>
- </whitelist>
- </filter>
+ <filter>
+ <whitelist>
+ <directory suffix=".php">./lib/Twig/</directory>
+ </whitelist>
+ </filter>
- <php>
- <const name="TWIG_LIBRARY_PATH" value="/path/to/library/where/Twig/located" />
- </php>
+ <php>
+ <!-- path to the Twig lib dir -->
+ <const name="TWIG_LIB_DIR" value="NOT_SET" />
+ </php>
</phpunit>
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-require_once TWIG_LIBRARY_PATH.'/../test/Twig/Tests/Node/TestCase.php';
+require_once TWIG_LIB_DIR.'/../test/Twig/Tests/Node/TestCase.php';
class Twig_Tests_Node_DebugTest extends Twig_Tests_Node_TestCase
{
View
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-if (!defined('TWIG_LIBRARY_PATH')) {
- die('path to twig library must be defined in phpunit.xml configuration');
+if (!defined('TWIG_LIB_DIR') || 'NOT_SET' === TWIG_LIB_DIR) {
+ die('The path to the Twig lib/ directory must be defined in phpunit.xml configuration.');
}
-require_once TWIG_LIBRARY_PATH.'/Twig/Autoloader.php';
+require_once TWIG_LIB_DIR.'/Twig/Autoloader.php';
Twig_Autoloader::register();
function twigExtensionAutoload($class)
@@ -27,4 +27,4 @@ function twigExtensionAutoload($class)
}
}
-spl_autoload_register('twigExtensionAutoload');
+spl_autoload_register('twigExtensionAutoload');

0 comments on commit 927dc5f

Please sign in to comment.