zoe             Sun Jun  7 11:06:51 2009 UTC

  Modified files:              
    /phpruntests/src/testcase   rtTestStatus.php rtTestDifference.php 
    /phpruntests/src/testcase/output    rtTestOutputWriterList.php 
    /phpruntests/src/testrun    rtPhpTestRun.php 
    /phpruntests/src/testgroup  rtPhpTestGroup.php 
  Log:
  move name to constructor in testStatus
  
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtTestStatus.php?r1=1.2&r2=1.3&diff_format=u
Index: phpruntests/src/testcase/rtTestStatus.php
diff -u phpruntests/src/testcase/rtTestStatus.php:1.2 
phpruntests/src/testcase/rtTestStatus.php:1.3
--- phpruntests/src/testcase/rtTestStatus.php:1.2       Tue Jun  2 19:12:07 2009
+++ phpruntests/src/testcase/rtTestStatus.php   Sun Jun  7 11:06:51 2009
@@ -17,7 +17,7 @@
     private $testName;
     private $states = array();
     private $messages = array();
-    private $stateName = array ('skip',
+    private $testStateNames = array ('skip',
                                 'bork',
                                 'warn',
                                 'xfail',
@@ -29,14 +29,15 @@
                                 'pass_headers',
     );
 
-    public function __construct()
+    public function __construct($testName)
     {
+        $this->testName = $testName;
         $this->init();
     }
 
     private function init()
     {
-        foreach ($this->stateName as $name) {
+        foreach ($this->testStateNames as $name) {
             $this->states[$name] = false;
             $this->messages[$name] = '';
         }
@@ -62,12 +63,8 @@
         return $this->messages[$name];
     }
     
-    public function getName() {
-        return $this->stateName;
-    }
-    
-    public function setTestName($name) {
-        $this->testName = $name;
+    public function getTestStateNames() {
+        return $this->testStateNames;
     }
     
     public function getTestName() {
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtTestDifference.php?r1=1.5&r2=1.6&diff_format=u
Index: phpruntests/src/testcase/rtTestDifference.php
diff -u phpruntests/src/testcase/rtTestDifference.php:1.5 
phpruntests/src/testcase/rtTestDifference.php:1.6
--- phpruntests/src/testcase/rtTestDifference.php:1.5   Fri Jun  5 09:30:19 2009
+++ phpruntests/src/testcase/rtTestDifference.php       Sun Jun  7 11:06:51 2009
@@ -62,7 +62,6 @@
      */
     public function generateArrayDiff($ar1, $ar2, $is_reg, $w)
     {
-        var_dump($is_reg);
          
         file_put_contents("/home/zoe/bug/ar1_my.out", $ar1);
         file_put_contents("/home/zoe/bug/ar2_my.out", $ar2);
@@ -204,8 +203,6 @@
     public function compLine($l1, $l2, $is_reg)
     {
         if ($is_reg) {
-          /*  var_dump($l1);
-            var_dump($l2);*/
             return preg_match((binary) "/^$l1$/s", (binary) $l2);
         } else {
             return !strcmp((binary) $l1, (binary) $l2);
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterList.php?r1=1.4&r2=1.5&diff_format=u
Index: phpruntests/src/testcase/output/rtTestOutputWriterList.php
diff -u phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.4 
phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.5
--- phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.4      Tue Jun 
 2 19:12:08 2009
+++ phpruntests/src/testcase/output/rtTestOutputWriterList.php  Sun Jun  7 
11:06:51 2009
@@ -33,7 +33,7 @@
         foreach ($testResults as $testResult) {
             $outputString = "";
             $testStatus = $testResult->getStatus();
-            foreach($testStatus->getName() as $name) {
+            foreach($testStatus->getTestStateNames() as $name) {
                 if($testStatus->getValue($name)) {
                     $outputString .= " ". strtoupper($name);
                     $outputString .= " " . $testStatus->getMessage($name);
http://cvs.php.net/viewvc.cgi/phpruntests/src/testrun/rtPhpTestRun.php?r1=1.10&r2=1.11&diff_format=u
Index: phpruntests/src/testrun/rtPhpTestRun.php
diff -u phpruntests/src/testrun/rtPhpTestRun.php:1.10 
phpruntests/src/testrun/rtPhpTestRun.php:1.11
--- phpruntests/src/testrun/rtPhpTestRun.php:1.10       Tue Jun  2 19:52:53 2009
+++ phpruntests/src/testrun/rtPhpTestRun.php    Sun Jun  7 11:06:51 2009
@@ -89,8 +89,8 @@
                     $testFile->doRead($testName);
                     $testFile->normaliseLineEndings($testName);
                     
-                    $testStatus = new rtTestStatus();
-                    $testStatus->setTestName($testFile->getTestName());
+                    $testStatus = new rtTestStatus($testFile->getTestName());
+                   
 
                     if ($testFile->arePreconditionsMet()) {
 
http://cvs.php.net/viewvc.cgi/phpruntests/src/testgroup/rtPhpTestGroup.php?r1=1.7&r2=1.8&diff_format=u
Index: phpruntests/src/testgroup/rtPhpTestGroup.php
diff -u phpruntests/src/testgroup/rtPhpTestGroup.php:1.7 
phpruntests/src/testgroup/rtPhpTestGroup.php:1.8
--- phpruntests/src/testgroup/rtPhpTestGroup.php:1.7    Tue Jun  2 19:12:08 2009
+++ phpruntests/src/testgroup/rtPhpTestGroup.php        Sun Jun  7 11:06:51 2009
@@ -28,20 +28,25 @@
     {
         $this->testFiles = rtUtil::getTestList($this->testDirectory);
 
-        foreach ($this->testFiles as $testName) {
+        foreach ($this->testFiles as $testFileName) {
+       
+            //testFiles is a list of file namnes relative to the current 
working directory
 
-            if (!file_exists($testName)) {
-                echo rtText::get('invalidTestFileName', array($testName));
+            if (!file_exists($testFileName)) {
+                echo rtText::get('invalidTestFileName', array($testFileName));
                 exit();
             }
 
             // Create a new test file object;
             $testFile = new rtPhpTestFile();
-            $testFile->doRead($testName);
+            $testFile->doRead($testFileName);
             $testFile->normaliseLineEndings();
+            
+            //The test name is the full path to the test file name without the 
.phpt
 
-            $testStatus = new rtTestStatus();
-            $testStatus->setTestName($testFile->getTestName());
+            $testStatus = new rtTestStatus($testFile->getTestName());
+             echo $testFile->getTestName() . "\n";
+            
             if ($testFile->arePreconditionsMet() ) {
                 // Create a new test case
                



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

Reply via email to