Changeset 141

Show
Ignore:
Timestamp:
03/06/08 12:05:24 (10 months ago)
Author:
iteman
Message:

- Fixed a defect that caused a target directory for autotest to be empty if a test directory is not specified.

Location:
trunk/src/Stagehand
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/Stagehand/TestRunner.php

    r136 r141  
    258258        } 
    259259 
    260         $directory = null; 
     260        $directory = getcwd(); 
    261261        $isRecursive = false; 
    262262        $color = false; 
  • trunk/src/Stagehand/TestRunner/Collector/Common.php

    r135 r141  
    112112    public function collect() 
    113113    { 
    114         if (is_null($this->_targetPath)) { 
    115             $absoluteTargetPath = getcwd(); 
    116         } else { 
    117             if (!file_exists($this->_targetPath)) { 
    118                 if (preg_match("/{$this->_suffix}\.php\$/", $this->_targetPath)) { 
    119                     throw new Stagehand_TestRunner_Exception("The directory or file [ {$this->_targetPath} ] is not found."); 
    120                 } 
    121  
    122                 $this->_targetPath = "{$this->_targetPath}{$this->_suffix}.php"; 
    123             } 
    124  
    125             $absoluteTargetPath = realpath($this->_targetPath); 
    126             if ($absoluteTargetPath === false) { 
     114        if (!file_exists($this->_targetPath)) { 
     115            if (preg_match("/{$this->_suffix}\.php\$/", $this->_targetPath)) { 
    127116                throw new Stagehand_TestRunner_Exception("The directory or file [ {$this->_targetPath} ] is not found."); 
    128117            } 
     118 
     119            $this->_targetPath = "{$this->_targetPath}{$this->_suffix}.php"; 
     120        } 
     121 
     122        $absoluteTargetPath = realpath($this->_targetPath); 
     123        if ($absoluteTargetPath === false) { 
     124            throw new Stagehand_TestRunner_Exception("The directory or file [ {$this->_targetPath} ] is not found."); 
    129125        } 
    130126