com phpruntests: fixing {PWD} in INI sections: src/testcase/sections/configurationsections/rtIniSection.php
| From: | David Soria Parra | Date: | Thu, 16 Jul 2009 16:01:01 +0000 |
| Subject: | com phpruntests: fixing {PWD} in INI sections: src/testcase/sections/configurationsections/rtIniSection.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66331@lists.php.net to get a copy of this message | ||
Commit: 8325cd8c3e9fc2e8a627d69f0d4b26e310a8ac98
Author: Zoe Slattery <zoe@php.net> Thu, 16 Jul 2009 16:01:01 +0000
Parents: 16e2c2143607bbf51bdff2699360eeb505c885c5
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=8325cd8c3e9fc2e8a627d69f0d4b26e310a8ac98
Log:
fixing {PWD} in INI sections
Changed paths:
M src/testcase/sections/configurationsections/rtIniSection.php
Diff:
diff --git a/src/testcase/sections/configurationsections/rtIniSection.php
b/src/testcase/sections/configurationsections/rtIniSection..php
index a748ccd..549b5fe 100644
--- a/src/testcase/sections/configurationsections/rtIniSection.php
+++ b/src/testcase/sections/configurationsections/rtIniSection.php
@@ -3,7 +3,7 @@
* rtIniSection
*
* Adds section content to the test ini settings
- *
+ *
* @category Testing
* @package RUNTESTS
* @author Zoe Slattery <zoe@php..net>
@@ -11,7 +11,7 @@
* @copyright 2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @link http://qa.php.net/
- *
+ *
*/
class rtIniSection extends rtConfigurationSection
{
@@ -19,11 +19,30 @@ class rtIniSection extends rtConfigurationSection
public function init()
{
+ }
+
+ /*
+ * There is an option to make the working directory the same as teh test'd directory using
the INI options.
+ * See for example tests/lang/bug32924.phpt.
+ * This is a plain stupid way to do it. It should go as soon as there is an implementation of a
SETUP section
+ */
+ public function substitutePWD ($fileName) {
+ $tempArray = array();
+ foreach ($this->sectionContents as $line) {
+ if (strpos($line, '{PWD}') !== false) {
+ $tempArray[] = str_replace('{PWD}', dirname($fileName), $line);
+ } else {
+ $tempArray[] = $line;
+ }
+
+ }
+
+ $this->sectionContents = $tempArray;
foreach ($this->sectionContents as $line) {
$this->commandLineArguments[] = addslashes($line);
}
}
-
+
/**
* Returns any additional PHP commandline arguments
*