Back to index

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