g2                                       Fri, 28 Aug 2009 22:31:24 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=287869

Log:
added os-check and env-var 'SystemRoot' for windows

Changed paths:
    U   php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php
    U   php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php
    U   php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php
    U   
php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php
    U   php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php
    U   
php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php
    U   php/phpruntests/trunk/src/testrun/rtPhpTestRun.php
    U   php/phpruntests/trunk/tests/configuration/rtEnvironmentVariablesTest.php

Modified: php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php
===================================================================
--- php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php  
2009-08-28 22:09:11 UTC (rev 287868)
+++ php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php  
2009-08-28 22:31:24 UTC (rev 287869)
@@ -33,10 +33,10 @@

     protected $environmentVariables = array();

-    public function __construct()
-    {
-    }
+
+    protected function __construct() {}

+
     static public function getInstance ($os = 'Unix')
     {
         if ($os == 'Windows') {
@@ -57,7 +57,6 @@
                 $this->environmentVariables[$variable] = getenv($variable);
             }
         }
-
     }

     public function setVariable($var,$value)

Modified: php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php
===================================================================
--- php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php 
2009-08-28 22:09:11 UTC (rev 287868)
+++ php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php 
2009-08-28 22:31:24 UTC (rev 287869)
@@ -22,6 +22,7 @@
     protected $settings;
     protected $environmentVariables;
     protected $commandLine;
+    protected $operatingSystem;

     protected $memoryTool = null;

@@ -58,7 +59,7 @@
         $this->commandLine->parse($this->commandLineArgs);

         //create object to hold environment variables
-        $this->environmentVariables = rtEnvironmentVariables::getInstance();
+        $this->environmentVariables = 
rtEnvironmentVariables::getInstance($this->operatingSystem);
     }

     /**

Modified: php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php
===================================================================
--- php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php        
2009-08-28 22:09:11 UTC (rev 287868)
+++ php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php        
2009-08-28 22:31:24 UTC (rev 287869)
@@ -17,7 +17,8 @@
 {
     public function __construct($cmdlineArgs)
     {
-        $this->commandLineArgs = $cmdlineArgs;
+        $this->operatingSystem = 'Unix';
+       $this->commandLineArgs = $cmdlineArgs;
         $this->init();
     }


Modified: 
php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php
===================================================================
--- php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php 
2009-08-28 22:09:11 UTC (rev 287868)
+++ php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php 
2009-08-28 22:31:24 UTC (rev 287869)
@@ -19,7 +19,7 @@
      * Adapts the environment to Unix
      *
      */
-    public function adaptEnvironment()
+    public function __construct()
     {
         array_push($this->userSuppliedVariables, 'TEST_PHP_PARALLEL');
     }

Modified: php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php
===================================================================
--- php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php      
2009-08-28 22:09:11 UTC (rev 287868)
+++ php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php      
2009-08-28 22:31:24 UTC (rev 287869)
@@ -17,7 +17,8 @@
 {
     public function __construct($cmdlineArgs)
     {
-        $this->commandLineArgs = $cmdlineArgs;
+        $this->operatingSystem = 'Windows';
+       $this->commandLineArgs = $cmdlineArgs;
         $this->init();
     }


Modified: 
php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php
===================================================================
--- 
php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php   
    2009-08-28 22:09:11 UTC (rev 287868)
+++ 
php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php   
    2009-08-28 22:31:24 UTC (rev 287869)
@@ -19,9 +19,9 @@
      * Adapts the environment variables for Windows
      *
      */
-    public function adaptEnvironment()
+    public function __construct()
     {
-        array_push($this->userSuppliedVariables, 'SystemRoot');
+       array_push($this->userSuppliedVariables, 'SystemRoot');
     }
 }
 ?>

Modified: php/phpruntests/trunk/src/testrun/rtPhpTestRun.php
===================================================================
--- php/phpruntests/trunk/src/testrun/rtPhpTestRun.php  2009-08-28 22:09:11 UTC 
(rev 287868)
+++ php/phpruntests/trunk/src/testrun/rtPhpTestRun.php  2009-08-28 22:31:24 UTC 
(rev 287869)
@@ -26,12 +26,15 @@
     {
         //Set SSH variables

+       // check the operation-system (win/unix)
+       $os = (substr(PHP_OS, 0, 3) == "WIN") ? 'Windows' : 'Unix';
+
         //Configure the test environment
-        $runConfiguration = 
rtRuntestsConfiguration::getInstance($this->commandLineArguments);
+        $runConfiguration = 
rtRuntestsConfiguration::getInstance($this->commandLineArguments, $os);
         $runConfiguration->getUserEnvironment();
         $runConfiguration->configure();
+

-
         //Check help message
         if($runConfiguration->hasCommandLineOption('help') || 
$runConfiguration->hasCommandLineOption('h')) {
             echo rtText::get('help');
@@ -39,7 +42,7 @@
         }

         //Check the preconditions
-        $preConditionList = rtPreConditionList::getInstance();
+        $preConditionList = rtPreConditionList::getInstance($os);

         // $preConditionList->check($this->commandLine, 
$this->environmentVariables);
         $preConditionList->check($runConfiguration);

Modified: 
php/phpruntests/trunk/tests/configuration/rtEnvironmentVariablesTest.php
===================================================================
--- php/phpruntests/trunk/tests/configuration/rtEnvironmentVariablesTest.php    
2009-08-28 22:09:11 UTC (rev 287868)
+++ php/phpruntests/trunk/tests/configuration/rtEnvironmentVariablesTest.php    
2009-08-28 22:31:24 UTC (rev 287869)
@@ -37,7 +37,6 @@
     {
         putenv('TEST_PHP_PARALLEL=a-parallel-run');
         $ev = rtEnvironmentVariables::getInstance();
-        $ev->adaptEnvironment();
         $ev->getUserSuppliedVariables();

         $this->assertEquals('a-parallel-run', 
$ev->getVariable('TEST_PHP_PARALLEL'));
@@ -47,7 +46,6 @@
     {
         putenv('SystemRoot=some-windows-thing');
         $ev = rtEnvironmentVariables::getInstance('Windows');
-        $ev->adaptEnvironment();
         $ev->getUserSuppliedVariables();

         $this->assertEquals('some-windows-thing', 
$ev->getVariable('SystemRoot'));

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

Reply via email to