Back to index

php5  5.3.10
gtBasicTestCaseFunction.php
Go to the documentation of this file.
00001 <?php
00002 
00007 class gtBasicTestCaseFunction extends gtBasicTestCase {
00008 
00009 
00010   public function __construct($opt) {
00011     $this->optionalSections = $opt;
00012   }
00013 
00019   public function setFunction($function) {
00020     $this->subject = $function;
00021   }
00022 
00023   public function constructTestCase() {
00024     $this->constructCommonHeaders();
00025     
00026     $this->addBasicEcho();
00027     
00028     $this->constructSubjectCalls();
00029     
00030     $this->constructCommonClosing();
00031    
00032   }
00033 
00034 
00039   public function testHeader() {
00040     //Opening section and start of test case array.
00041     $this->testCase[] = "--TEST--";
00042     $this->testCase[] = "Test function ".$this->subject->getName()."() by calling it with its expected arguments";
00043   }
00044 
00049   public function subjectCalls() {
00050     // Construct the argument list to pass to the function being tested
00051     $lists = $this->subject->getValidArgumentLists();
00052 
00053     foreach($lists as $list){
00054 
00055       $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
00056       $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
00057     }
00058     $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
00059   }
00060 
00061 }
00062 ?>