Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
s/dirname(__FILE__)/__DIR__/g
Browse files Browse the repository at this point in the history
- Replaced dirname(__FILE__) calls with __DIR__ throughout the codebase
  • Loading branch information
weierophinney committed Jul 12, 2010
2 parents 3da744a + a6eeacd commit 9201751
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/AutoloadDoesNotHideParseError.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
2 changes: 1 addition & 1 deletion test/AutoloaderMultiVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testSettingZfPathFailsWhenBasePathDoesNotExist()
*/
public function testSettingZfVersionFailsWhenNoValidInstallsDiscovered()
{
$this->autoloader->setZfPath(dirname(__FILE__), 'latest');
$this->autoloader->setZfPath(__DIR__, 'latest');
}

public function testAutoloadLatestUsesLatestVersion()
Expand Down
4 changes: 2 additions & 2 deletions test/AutoloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,15 +418,15 @@ 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);
}

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)
Expand Down
10 changes: 5 additions & 5 deletions test/PluginLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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) {
Expand Down Expand Up @@ -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');
Expand All @@ -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) {
Expand Down

0 comments on commit 9201751

Please sign in to comment.