Skip to content
This repository has been archived by the owner on Jan 29, 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 b2a812b + 59c83c4 commit 8f4a51f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
24 changes: 12 additions & 12 deletions test/IniTest.php
Expand Up @@ -40,14 +40,14 @@ class IniTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->_iniFileConfig = dirname(__FILE__) . '/_files/config.ini';
$this->_iniFileAllSectionsConfig = dirname(__FILE__) . '/_files/allsections.ini';
$this->_iniFileCircularConfig = dirname(__FILE__) . '/_files/circular.ini';
$this->_iniFileMultipleInheritanceConfig = dirname(__FILE__) . '/_files/multipleinheritance.ini';
$this->_iniFileSeparatorConfig = dirname(__FILE__) . '/_files/separator.ini';
$this->_nonReadableConfig = dirname(__FILE__) . '/_files/nonreadable.ini';
$this->_iniFileNoSectionsConfig = dirname(__FILE__) . '/_files/nosections.ini';
$this->_iniFileInvalid = dirname(__FILE__) . '/_files/invalid.ini';
$this->_iniFileConfig = __DIR__ . '/_files/config.ini';
$this->_iniFileAllSectionsConfig = __DIR__ . '/_files/allsections.ini';
$this->_iniFileCircularConfig = __DIR__ . '/_files/circular.ini';
$this->_iniFileMultipleInheritanceConfig = __DIR__ . '/_files/multipleinheritance.ini';
$this->_iniFileSeparatorConfig = __DIR__ . '/_files/separator.ini';
$this->_nonReadableConfig = __DIR__ . '/_files/nonreadable.ini';
$this->_iniFileNoSectionsConfig = __DIR__ . '/_files/nosections.ini';
$this->_iniFileInvalid = __DIR__ . '/_files/invalid.ini';
}

public function testLoadSingleSection()
Expand Down Expand Up @@ -205,7 +205,7 @@ public function testZF2508NoSections()

public function testZF2843NoSectionNoTree()
{
$filename = dirname(__FILE__) . '/_files/zf2843.ini';
$filename = __DIR__ . '/_files/zf2843.ini';
$config = new Ini($filename, null, array('nestSeparator' => '.'));

$this->assertEquals('123', $config->abc);
Expand All @@ -229,7 +229,7 @@ public function testZF3196_InvalidIniFile()
public function testZF8159()
{
$config = new Ini(
dirname(__FILE__) . '/_files/zf8159.ini',
__DIR__ . '/_files/zf8159.ini',
array('first', 'second')
);

Expand All @@ -249,7 +249,7 @@ public function testZF8159()
*/
public function testArraysOfKeysCreatedUsingAttributesAndKeys()
{
$filename = dirname(__FILE__) . '/_files/zf5800.ini';
$filename = __DIR__ . '/_files/zf5800.ini';
$config = new Ini($filename, 'dev');
$this->assertEquals('nice.guy@company.com', $config->receiver->{0}->mail);
$this->assertEquals('1', $config->receiver->{0}->html);
Expand All @@ -261,7 +261,7 @@ public function testArraysOfKeysCreatedUsingAttributesAndKeys()
*/
public function testPreservationOfIntegerKeys()
{
$filename = dirname(__FILE__) . '/_files/zf6508.ini';
$filename = __DIR__ . '/_files/zf6508.ini';
$config = new Ini($filename, 'all');
$this->assertEquals(true, isset($config->{1002}));

Expand Down
2 changes: 1 addition & 1 deletion test/Writer/ArrayWriterTest.php
Expand Up @@ -39,7 +39,7 @@ class ArrayWriterTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->_tempName = tempnam(dirname(__FILE__) . '/temp', 'tmp');
$this->_tempName = tempnam(__DIR__ . '/temp', 'tmp');
}

public function tearDown()
Expand Down
8 changes: 4 additions & 4 deletions test/Writer/IniTest.php
Expand Up @@ -40,7 +40,7 @@ class IniTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->_tempName = tempnam(dirname(__FILE__) . '/temp', 'tmp');
$this->_tempName = tempnam(__DIR__ . '/temp', 'tmp');
}

public function tearDown()
Expand Down Expand Up @@ -97,7 +97,7 @@ public function testNoSection()

public function testWriteAndReadOriginalFile()
{
$config = new IniConfig(dirname(__FILE__) . '/files/allsections.ini', null, array('skipExtends' => true));
$config = new IniConfig(__DIR__ . '/files/allsections.ini', null, array('skipExtends' => true));

$writer = new Ini(array('config' => $config, 'filename' => $this->_tempName));
$writer->write();
Expand All @@ -112,7 +112,7 @@ public function testWriteAndReadOriginalFile()

public function testWriteAndReadSingleSection()
{
$config = new IniConfig(dirname(__FILE__) . '/files/allsections.ini', 'staging', array('skipExtends' => true));
$config = new IniConfig(__DIR__ . '/files/allsections.ini', 'staging', array('skipExtends' => true));

$writer = new Ini(array('config' => $config, 'filename' => $this->_tempName));
$writer->write();
Expand Down Expand Up @@ -175,7 +175,7 @@ public function testRenderWithoutSections()

public function testRenderWithoutSections2()
{
$config = new IniConfig(dirname(__FILE__) . '/files/allsections.ini', null, array('skipExtends' => true));
$config = new IniConfig(__DIR__ . '/files/allsections.ini', null, array('skipExtends' => true));

$writer = new Ini();
$writer->setRenderWithoutSections();
Expand Down
6 changes: 3 additions & 3 deletions test/Writer/XmlTest.php
Expand Up @@ -40,7 +40,7 @@ class XmlTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->_tempName = tempnam(dirname(__FILE__) . '/temp', 'tmp');
$this->_tempName = tempnam(__DIR__ . '/temp', 'tmp');
}

public function tearDown()
Expand Down Expand Up @@ -99,7 +99,7 @@ public function testNoSection()

public function testWriteAndReadOriginalFile()
{
$config = new XmlConfig(dirname(__FILE__) . '/files/allsections.xml', null, array('skipExtends' => true));
$config = new XmlConfig(__DIR__ . '/files/allsections.xml', null, array('skipExtends' => true));

$writer = new Xml(array('config' => $config, 'filename' => $this->_tempName));
$writer->write();
Expand All @@ -113,7 +113,7 @@ public function testWriteAndReadOriginalFile()

public function testWriteAndReadSingleSection()
{
$config = new XmlConfig(dirname(__FILE__) . '/files/allsections.xml', 'staging', array('skipExtends' => true));
$config = new XmlConfig(__DIR__ . '/files/allsections.xml', 'staging', array('skipExtends' => true));

$writer = new Xml(array('config' => $config, 'filename' => $this->_tempName));
$writer->write();
Expand Down
20 changes: 10 additions & 10 deletions test/XmlTest.php
Expand Up @@ -41,16 +41,16 @@ class XmlTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->_xmlFileConfig = dirname(__FILE__) . '/_files/config.xml';
$this->_xmlFileAllSectionsConfig = dirname(__FILE__) . '/_files/allsections.xml';
$this->_xmlFileCircularConfig = dirname(__FILE__) . '/_files/circular.xml';
$this->_xmlFileTopLevelStringConfig = dirname(__FILE__) . '/_files/toplevelstring.xml';
$this->_xmlFileOneTopLevelStringConfig = dirname(__FILE__) . '/_files/onetoplevelstring.xml';
$this->_nonReadableConfig = dirname(__FILE__) . '/_files/nonreadable.xml';
$this->_xmlFileSameNameKeysConfig = dirname(__FILE__) . '/_files/array.xml';
$this->_xmlFileShortParamsOneConfig = dirname(__FILE__) . '/_files/shortparamsone.xml';
$this->_xmlFileShortParamsTwoConfig = dirname(__FILE__) . '/_files/shortparamstwo.xml';
$this->_xmlFileInvalid = dirname(__FILE__) . '/_files/invalid.xml';
$this->_xmlFileConfig = __DIR__ . '/_files/config.xml';
$this->_xmlFileAllSectionsConfig = __DIR__ . '/_files/allsections.xml';
$this->_xmlFileCircularConfig = __DIR__ . '/_files/circular.xml';
$this->_xmlFileTopLevelStringConfig = __DIR__ . '/_files/toplevelstring.xml';
$this->_xmlFileOneTopLevelStringConfig = __DIR__ . '/_files/onetoplevelstring.xml';
$this->_nonReadableConfig = __DIR__ . '/_files/nonreadable.xml';
$this->_xmlFileSameNameKeysConfig = __DIR__ . '/_files/array.xml';
$this->_xmlFileShortParamsOneConfig = __DIR__ . '/_files/shortparamsone.xml';
$this->_xmlFileShortParamsTwoConfig = __DIR__ . '/_files/shortparamstwo.xml';
$this->_xmlFileInvalid = __DIR__ . '/_files/invalid.xml';
}

public function testLoadSingleSection()
Expand Down

0 comments on commit 8f4a51f

Please sign in to comment.