Back to index

php5  5.3.10
gtErrorTestCaseFunction.php
Go to the documentation of this file.
00001 <?php
00002 
00007 class gtErrorTestCaseFunction extends gtErrorTestCase {
00008 
00009   public function __construct($opt) {
00010     $this->optionalSections = $opt;
00011   }
00012 
00018   public function setFunction($function) {
00019     $this->subject = $function;
00020   }
00021 
00022 
00027   public function constructTestCase() {
00028     $this->constructCommonHeaders();
00029     
00030     $this->addErrorEcho();
00031       
00032     $this->constructSubjectCalls();
00033     
00034     $this->constructCommonClosing();
00035     
00036   }
00037 
00038 
00039   public function testHeader() {
00040     $this->testCase[] = "--TEST--";
00041     $this->testCase[] = "Test function ".$this->subject->getName()."() by calling it more than or less than its expected arguments";
00042   }
00043 
00044   public function subjectCalls() {
00045     // Construct the argument lists to pass to the function being tested
00046     $list = $this->subject->getExtraArgumentList();
00047     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
00048     $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
00049 
00050     $list = $this->subject->getShortArgumentList();
00051     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
00052     $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
00053     $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
00054   }
00055 
00056 }
00057 ?>