From c525a09078676d033ef6af6b3bb3f6d4eb6cc19d Mon Sep 17 00:00:00 2001 From: Anton Grebnev Date: Tue, 11 Dec 2012 16:46:53 +0400 Subject: [PATCH] fixed AutoloadBuilderTest to pass without template app --- tests/util/AutoloadBuilderTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/util/AutoloadBuilderTest.php b/tests/util/AutoloadBuilderTest.php index c31000a..92ffcc4 100644 --- a/tests/util/AutoloadBuilderTest.php +++ b/tests/util/AutoloadBuilderTest.php @@ -24,6 +24,8 @@ class AutoloadBuilderTest extends PHPUnit_Framework_TestCase private static $path; + private static $lib_path; + private static $app; public function run(PHPUnit_Framework_TestResult $result = NULL) @@ -38,13 +40,14 @@ class AutoloadBuilderTest extends PHPUnit_Framework_TestCase public static function setUpBeforeClass() { self::$path = realpath(dirname(__FILE__) . '/../../../..'); + self::$lib_path = realpath(dirname(__FILE__) . '/../..'); self::$app = 'lib/core/tests/face'; self::$file = self::$path . '/' . self::$app . '/cache/autoload.php'; self::$inc_dirs[self::$path . '/' . self::$app . '/src'] = true; self::$inc_dirs[self::$path . '/' . self::$app . '/cache'] = true; - self::$inc_dirs[self::$path . '/lib'] = true; + self::$inc_dirs[self::$lib_path . '/'] = true; foreach (self::$inc_dirs as $dir => &$is_exist) { if (!file_exists($dir)) { @@ -83,6 +86,7 @@ class AutoloadBuilderTest extends PHPUnit_Framework_TestCase $this->assertFileExists(self::$file); $array = require self::$file; + $this->assertFileExists(self::$file); $this->assertInternalType('array', $array); $this->assertNotEmpty($array); $this->assertArrayHasKey('AutoloadBuilder', $array); @@ -95,7 +99,7 @@ class AutoloadBuilderTest extends PHPUnit_Framework_TestCase public function testBuildWithExcluded() { $this->setConstants(); - $builder = new AutoloadBuilder(self::$file, array_keys(self::$inc_dirs), array(self::$path . '/lib/core/app/')); + $builder = new AutoloadBuilder(self::$file, array_keys(self::$inc_dirs), array(self::$lib_path . '/app/')); $this->assertFileNotExists(self::$file); $builder->build();