Back to index

php5  5.3.10
gtErrorTestCase.php
Go to the documentation of this file.
00001 <?php
00002 
00007 abstract class gtErrorTestCase extends gtTestCase {
00008 
00009   protected $shortArgumentList = '';
00010   protected $longArgumentList = '';
00011 
00012 
00019   public static function getInstance($optionalSections, $type = 'function') {
00020      
00021     if($type == 'function') {
00022       return new gtErrorTestCaseFunction($optionalSections);
00023     }
00024     if($type =='method') {
00025       return new gtErrorTestCaseMethod($optionalSections);
00026     }
00027 
00028   }
00029 
00030   public function getShortArgumentList() {
00031     return $this->shortArgumentList;
00032   }
00033 
00034   public function getLongArgumentList() {
00035     return $this->longArgumentList;
00036   }
00037   
00038   public function constructSubjectCalls() {
00039     $this->argInit();
00040     
00041     //Initialise the additional argument
00042     $this->testCase[] = "\$extra_arg = ";
00043     
00044     $this->subjectCalls();
00045   }
00046   
00047  public function addErrorEcho() {
00048     $this->testCase[] = "echo \"*** Test by calling method or function with incorrect numbers of arguments ***\\n\";";
00049     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
00050   }
00051 }
00052 
00053 ?>