예제 #1
0
 public function subjectCalls()
 {
     $lists = $this->subject->getValidArgumentLists();
     foreach ($lists as $list) {
         $this->testCase[] = "var_dump( \$class->" . $this->subject->getName() . "( " . $list . " ) );";
         $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase);
     }
     $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase);
 }
예제 #2
0
 /**
  * Add the test section to call the function
  *
  */
 public function subjectCalls()
 {
     // Construct the argument list to pass to the function being tested
     $lists = $this->subject->getValidArgumentLists();
     foreach ($lists as $list) {
         $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase);
         $this->testCase[] = "var_dump(" . $this->subject->getName() . "( " . $list . " ) );";
     }
     $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase);
 }
 public function subjectCalls()
 {
     $this->testCase = gtCodeSnippet::append('loopStart', $this->testCase);
     // Construct the argument list to pass to the method being tested
     $argumentList = explode(",", $this->subject->getMaximumArgumentList());
     $argumentList[$this->argumentNumber - 1] = "\$var ";
     $list = implode(", ", $argumentList);
     $this->testCase[] = "  var_dump(\$class->" . $this->subject->getName() . "( " . $list . " ) );";
     $this->testCase = gtCodeSnippet::append('loopClose', $this->testCase);
 }
예제 #4
0
 public function subjectCalls()
 {
     // Construct the argument list to pass to the method being tested
     $list = $this->subject->getExtraArgumentList();
     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase);
     $this->testCase[] = "var_dump(" . $this->subject->getName() . "( " . $list . " ) );";
     $list = $this->subject->getShortArgumentList();
     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase);
     $this->testCase[] = "var_dump(" . $this->subject->getName() . "( " . $list . " ) );";
 }
예제 #5
0
 public function addErrorEcho()
 {
     $this->testCase[] = "echo \"*** Test by calling method or function with incorrect numbers of arguments ***\\n\";";
     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase);
 }
예제 #6
0
 public function addBasicEcho()
 {
     $this->testCase[] = "echo \"*** Test by calling method or function with its expected arguments ***\\n\";";
     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase);
 }
예제 #7
0
 public function addVariationEcho()
 {
     $this->testCase[] = "echo \"*** Test substituting argument " . $this->argumentNumber . " with " . $this->variationData . " values ***\\n\";";
     $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase);
 }
예제 #8
0
 /**
  * Add a skipif section to the test case
  *
  */
 public function addSkipif()
 {
     $this->testCase[] = "--SKIPIF--";
     $this->testCase[] = "<?php";
     if ($this->optionalSections->hasSkipifKey()) {
         $key = $this->optionalSections->getSkipifKey();
         //test standard skipif sections
         if ($key == 'win') {
             $this->testCase = gtCodeSnippet::append('skipifwin', $this->testCase);
         }
         if ($key == 'notwin') {
             $this->testCase = gtCodeSnippet::append('skipifnotwin', $this->testCase);
         }
         if ($key == '64b') {
             $this->testCase = gtCodeSnippet::append('skipif64b', $this->testCase);
         }
         if ($key == 'not64b') {
             $this->testCase = gtCodeSnippet::append('skipifnot64b', $this->testCase);
         }
     }
     if ($this->optionalSections->hasSkipifExt()) {
         $ext = $this->optionalSections->getSkipifExt();
         $this->testCase[] = "if (!extension_loaded('{$ext}')) die ('skip {$ext} extension not available in this build');";
     }
     $this->testCase[] = "?>";
 }
예제 #9
0
 public function testAppend()
 {
     $array = array('something', 'nothing');
     $array = gtCodeSnippet::append('loopClose', $array);
     $this->assertEquals($array[2], '}');
 }