Exemplo n.º 1
0
 /**
  * @large
  */
 public function testGenerateGif()
 {
     $syntaxFile = $this->fixtureDir . DIRECTORY_SEPARATOR . "test_grammar.ebnf";
     $outFile = self::$testDir->get() . DIRECTORY_SEPARATOR . "out.gif";
     $this->assertEquals(Command::EBNF_OK, Command::main(array("s" => $syntaxFile, "o" => $outFile, "f" => "gif")));
     $this->assertTrue(file_get_contents($this->fixtureDir . DIRECTORY_SEPARATOR . "test_grammar.gif") === file_get_contents($outFile));
 }
Exemplo n.º 2
0
 public function testCreateAndRemove()
 {
     $dir = new TestDirHelper();
     $this->assertFalse(file_exists($dir->get()));
     $dir->create();
     $this->assertTrue(file_exists($dir->get()));
     $this->assertTrue(is_dir($dir->get()));
     $dir->remove();
     $this->assertFalse(file_exists($dir->get()));
 }
Exemplo n.º 3
0
 /**
  * @large
  * @expectedException        \InvalidArgumentException
  * @expectedExceptionMessage Unsupported format: 'foo'!
  */
 public function testThrowExceptionOnInvalidFormat()
 {
     $renderer = new Renderer("foo", self::$testDir->get() . "/out.foo", $this->createAst());
     $renderer->save();
 }