diff --git a/test/IniTest.php b/test/IniTest.php index 9665a09..954ff9d 100644 --- a/test/IniTest.php +++ b/test/IniTest.php @@ -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() @@ -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); @@ -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') ); @@ -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); @@ -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})); diff --git a/test/Writer/ArrayWriterTest.php b/test/Writer/ArrayWriterTest.php index 7e42218..d617d90 100644 --- a/test/Writer/ArrayWriterTest.php +++ b/test/Writer/ArrayWriterTest.php @@ -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() diff --git a/test/Writer/IniTest.php b/test/Writer/IniTest.php index 5604d36..3c7084c 100644 --- a/test/Writer/IniTest.php +++ b/test/Writer/IniTest.php @@ -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() @@ -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(); @@ -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(); @@ -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(); diff --git a/test/Writer/XmlTest.php b/test/Writer/XmlTest.php index f95043e..d4ff8fe 100644 --- a/test/Writer/XmlTest.php +++ b/test/Writer/XmlTest.php @@ -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() @@ -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(); @@ -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(); diff --git a/test/XmlTest.php b/test/XmlTest.php index 9497cc8..4ee45bc 100644 --- a/test/XmlTest.php +++ b/test/XmlTest.php @@ -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()