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); }
public function addVariationCode() { $this->testCase = gtCodeSnippet::append($this->variationData, $this->testCase); $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase); }
/** * 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[] = "?>"; }
public function testAppend() { $array = array('something', 'nothing'); $array = gtCodeSnippet::append('loopClose', $array); $this->assertEquals($array[2], '}'); }