Skip to content

Commit

Permalink
tweaked Twig dir definition for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Dec 15, 2010
1 parent 26bf47e commit 927dc5f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
27 changes: 14 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion test/Twig/Tests/Node/DebugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.