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() { $hl = new Highlighter(); $hl->setTabReplace(" "); $data = $this->getTestData("tabreplace"); $actual = $hl->highlight("python", $data->code); $this->assertEquals($data->expected, $actual->value); } public function testLanguageAlias() { $hl = new Highlighter(); $data = $this->getTestData("languagealias"); $actual = $hl->highlight("js", $data->code); $this->assertEquals($data->expected, $actual->value); } public function testSubLanguage() { $hl = new Highlighter(); $data = $this->getTestData("sublanguages"); $actual = $hl->highlight("xml", $data->code); $this->assertEquals($data->expected, $actual->value); } public function testWindowsCRLF() { $hl = new Highlighter(); $data = $this->getTestData("line-endings.crlf"); $actual = $hl->highlight("js", $data->code); $this->assertEquals($data->expected, $actual->value); } }