Exemplo n.º 1
0
 /**
  * @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);
 }
Exemplo n.º 2
0
 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());
 }
Exemplo n.º 3
0
 /**
  * This test checks a that the resolved type is NULL.
  *
  * @return void
  */
 public function testGetTypeWithoutValue()
 {
     $annotation = new Result('Result', array());
     $this->assertNull($annotation->getType());
 }