Back to index

php5  5.3.10
gtVariationTestCase.php
Go to the documentation of this file.
00001 
00002 <?php
00003 
00008 abstract class gtVariationTestCase extends gtTestCase {
00009 
00010 
00017   public static function getInstance($optionalSections, $type = 'function') {
00018      
00019     if($type == 'function') {
00020       return new gtVariationTestCaseFunction($optionalSections);
00021     }
00022     if($type =='method') {
00023       return new gtVariationTestCaseMethod($optionalSections);
00024     }
00025 
00026   }
00027 
00028   public function argInitVariation() {
00029     $statements = $this->subject->getInitialisationStatements();
00030     for($i=0; $i<count($statements); $i++) {
00031       if($i != ( $this->argumentNumber -1) ) {
00032         $this->testCase[] = $statements[$i];
00033       }
00034     }
00035     $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
00036   }
00037 
00038   public function addVariationCode() {
00039     $this->testCase = gtCodeSnippet::append($this->variationData, $this->testCase);
00040     $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
00041   }
00042 
00043   public function constructSubjectCalls() {
00044     $this->argInitVariation();
00045     $this->addVariationCode();
00046     $this->subjectCalls();
00047   }
00048 
00049   public function addVariationEcho() {
00050     $this->testCase[] = "echo \"*** Test substituting argument ".$this->argumentNumber." with ".$this->variationData." values ***\\n\";";
00051     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
00052   }
00053 
00054 }
00055 ?>