diff --git a/test/AutoloadDoesNotHideParseError.php b/test/AutoloadDoesNotHideParseError.php index 82d74fa..f10af7c 100644 --- a/test/AutoloadDoesNotHideParseError.php +++ b/test/AutoloadDoesNotHideParseError.php @@ -30,6 +30,6 @@ Zend_Loader::registerAutoload(); -set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/_files'); +set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/_files'); $parseError = new ParseError(); diff --git a/test/AutoloaderMultiVersionTest.php b/test/AutoloaderMultiVersionTest.php index 7388e51..4ed5c63 100644 --- a/test/AutoloaderMultiVersionTest.php +++ b/test/AutoloaderMultiVersionTest.php @@ -106,7 +106,7 @@ public function testSettingZfPathFailsWhenBasePathDoesNotExist() */ public function testSettingZfVersionFailsWhenNoValidInstallsDiscovered() { - $this->autoloader->setZfPath(dirname(__FILE__), 'latest'); + $this->autoloader->setZfPath(__DIR__, 'latest'); } public function testAutoloadLatestUsesLatestVersion() diff --git a/test/AutoloaderTest.php b/test/AutoloaderTest.php index 52cbd2b..c2ee9ac 100644 --- a/test/AutoloaderTest.php +++ b/test/AutoloaderTest.php @@ -418,7 +418,7 @@ public function testClosuresRegisteredWithAutoloaderShouldBeUtilized() } $this->autoloader->pushAutoloader(function($class) { - require_once dirname(__FILE__) . '/_files/AutoloaderClosure.php'; + require_once __DIR__ . '/_files/AutoloaderClosure.php'; }); $test = new AutoloaderTest_AutoloaderClosure(); $this->assertTrue($test instanceof AutoloaderTest_AutoloaderClosure); @@ -426,7 +426,7 @@ public function testClosuresRegisteredWithAutoloaderShouldBeUtilized() public function addTestIncludePath() { - set_include_path(dirname(__FILE__) . '/_files/' . PATH_SEPARATOR . $this->includePath); + set_include_path(__DIR__ . '/_files/' . PATH_SEPARATOR . $this->includePath); } public function handleErrors($errno, $errstr) diff --git a/test/PluginLoaderTest.php b/test/PluginLoaderTest.php index 27c2f96..ce4e082 100644 --- a/test/PluginLoaderTest.php +++ b/test/PluginLoaderTest.php @@ -330,7 +330,7 @@ public function testClassFilesAreSearchedInLifoOrder() { $loader = new PluginLoader(array()); $loader->addPrefixPath('Zend_View_Helper', $this->libPath . '/Zend/View/Helper'); - $loader->addPrefixPath('ZfTest', dirname(__FILE__) . '/_files/ZfTest'); + $loader->addPrefixPath('ZfTest', __DIR__ . '/_files/ZfTest'); try { $className = $loader->load('FormSubmit'); } catch (Exception $e) { @@ -383,7 +383,7 @@ public function testPluginLoaderShouldAllowSpecifyingIncludeFileCache() public function testPluginLoaderShouldThrowExceptionWhenPathDoesNotExist() { $this->setExpectedException('\\Zend\\Loader\\PluginLoaderException', 'file does not exist'); - $cacheFile = dirname(__FILE__) . '/_filesDoNotExist/includeCache.inc.php'; + $cacheFile = __DIR__ . '/_filesDoNotExist/includeCache.inc.php'; $this->testIncludeCacheShouldBeNullByDefault(); PluginLoader::setIncludeFileCache($cacheFile); } @@ -397,7 +397,7 @@ public function testPluginLoaderShouldAppendIncludeCacheWhenClassIsFound() PluginLoader::setIncludeFileCache($cacheFile); $loader = new PluginLoader(array()); $loader->addPrefixPath('Zend_View_Helper', $this->libPath . '/Zend/View/Helper'); - $loader->addPrefixPath('ZfTest', dirname(__FILE__) . '/_files/ZfTest'); + $loader->addPrefixPath('ZfTest', __DIR__ . '/_files/ZfTest'); try { $className = $loader->load('CacheTest'); } catch (Exception $e) { @@ -433,7 +433,7 @@ public function testClassFilesGrabCorrectPathForLoadedClasses() $loader = new PluginLoader(array()); $loader->addPrefixPath('Zend_View_Helper', $this->libPath . '/Zend/View/Helper'); - $loader->addPrefixPath('ZfTest', dirname(__FILE__) . '/_files/ZfTest'); + $loader->addPrefixPath('ZfTest', __DIR__ . '/_files/ZfTest'); try { // Class in /Zend/View/Helper and not in /_files/ZfTest $className = $loader->load('DeclareVars'); @@ -452,7 +452,7 @@ public function testClassFilesGrabCorrectPathForLoadedClasses() public function testPrefixesEndingInBackslashDenoteNamespacedClasses() { $loader = new PluginLoader(array()); - $loader->addPrefixPath('Zfns\\', dirname(__FILE__) . '/_files/Zfns'); + $loader->addPrefixPath('Zfns\\', __DIR__ . '/_files/Zfns'); try { $className = $loader->load('Foo'); } catch (Exception $e) {