hl = new Highlight\Highlighter(); // var_dump($this->hl->listLanguages()); } private function getTestData($name) { return (object) array( "code" => file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "special" . DIRECTORY_SEPARATOR . "{$name}.txt"), "expected" => file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "special" . DIRECTORY_SEPARATOR . "{$name}.expect.txt") ); } public function testTabReplace() { $this->hl->setTabReplace(" "); $data = $this->getTestData("tabreplace"); $this->assertEquals($data->expected, $this->hl->highlight("python", $data->code)->value); $this->hl->setTabReplace(null); } public function testLanguageAlias() { $data = $this->getTestData("languagealias"); $this->assertEquals($data->expected, $this->hl->highlight("js", $data->code)->value); } public function testSubLanguage() { $data = $this->getTestData("sublanguages"); $this->assertEquals($data->expected, $this->hl->highlight("xml", $data->code)->value); } }