/** * @param Result $result * @param bool $withCodeSnippet * @return string */ public function writeResult(Result $result, $withCodeSnippet = true) { $string = "Forgotten dump '{$result->getType()}' found in {$result->getShortFilePath()}:{$result->getLineNumber()}" . PHP_EOL; if ($withCodeSnippet) { $string .= $this->getCodeSnippet(file_get_contents($result->getFilePath()), $result->getLineNumber()); } $this->writer->write($string); }
function testPage() { $XML = simplexml_load_string($this->pageString, "SimpleXMLElement"); $result = new Result($XML); $this->assertEquals("SUCCESS", $result->getName()); $this->assertEquals("pages.test", $result->getTarget()); $this->assertEquals("minimal", $result->getTemplateName()); $this->assertEquals("page", $result->getType()); $this->assertEquals("pages/test.php", $result->getViewLocation()); }
/** * This test checks a that the resolved type is NULL. * * @return void */ public function testGetTypeWithoutValue() { $annotation = new Result('Result', array()); $this->assertNull($annotation->getType()); }