|
|
@ -75,7 +75,7 @@ class AutoloadBuilderTest extends PHPUnit_Framework_TestCase |
|
|
|
public function testBuild() |
|
|
|
{ |
|
|
|
$this->setConstants(); |
|
|
|
$builder = new AutoloadBuilder(self::$file, array(self::$path . '/' . self::$app . '/src', self::$path . '/' . self::$app . '/cache', self::$path . '/lib')); |
|
|
|
$builder = new AutoloadBuilder(self::$file, array_keys(self::$inc_dirs)); |
|
|
|
|
|
|
|
$this->assertFileNotExists(self::$file); |
|
|
|
$builder->build(); |
|
|
@ -92,18 +92,38 @@ class AutoloadBuilderTest extends PHPUnit_Framework_TestCase |
|
|
|
/** |
|
|
|
* @runInSeparateProcess |
|
|
|
*/ |
|
|
|
public function testAccessDenied() |
|
|
|
public function testBuildWithExcluded() |
|
|
|
{ |
|
|
|
$this->setConstants(); |
|
|
|
$builder = new AutoloadBuilder(self::$file, array_keys(self::$inc_dirs), array(self::$path . '/lib/core/app/')); |
|
|
|
|
|
|
|
$this->setExpectedException('PHPUnit_Framework_Error'); |
|
|
|
$this->assertFileNotExists(self::$file); |
|
|
|
$builder->build(); |
|
|
|
|
|
|
|
touch(self::$file); |
|
|
|
$this->assertFileExists(self::$file); |
|
|
|
chmod(self::$file, 0400); |
|
|
|
|
|
|
|
$array = require self::$file; |
|
|
|
$this->assertInternalType('array', $array); |
|
|
|
$this->assertNotEmpty($array); |
|
|
|
$this->assertArrayHasKey('AutoloadBuilder', $array); |
|
|
|
$this->assertArrayNotHasKey('FrontController', $array); |
|
|
|
$this->assertArrayNotHasKey('AjaxAction', $array); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @runInSeparateProcess |
|
|
|
*/ |
|
|
|
public function testAccessDenied() |
|
|
|
{ |
|
|
|
$this->setConstants(); |
|
|
|
|
|
|
|
$this->assertFileNotExists(self::$file); |
|
|
|
|
|
|
|
$path = dirname(self::$file); |
|
|
|
chmod($path, 0400); |
|
|
|
$builder = new AutoloadBuilder(self::$file, array(self::$path . '/' . self::$app . '/src', self::$path . '/' . self::$app . '/cache', self::$path . '/lib')); |
|
|
|
|
|
|
|
$this->setExpectedException('PHPUnit_Framework_Error', 'Permission denied'); |
|
|
|
$builder->build(); |
|
|
|
chmod(self::$file, 0777); |
|
|
|
} |
|
|
|