zoe             Thu, 16 Jul 2009 16:01:01 +0000

URL: http://svn.php.net/viewvc?view=revision&revision=284192

Changed paths:
        U   
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtIniSection.php

Log:
fixing {PWD} in INI sections

Modified: 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtIniSection.php
===================================================================
--- 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtIniSection.php
  2009-07-16 16:00:04 UTC (rev 284191)
+++ 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtIniSection.php
  2009-07-16 16:01:01 UTC (rev 284192)
@@ -3,7 +3,7 @@
  * rtIniSection
  *
  * Adds section content to the test ini settings
- *
+ *
  * @category   Testing
  * @package    RUNTESTS
  * @author     Zoe Slattery <z...@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 @@

     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
      *

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to