示例#1
0
 public function testSingleton()
 {
     $formatter = new HtmlFormatter();
     $language = new MockGreedyLanguage(['rules' => ['keyword' => new Rule(new SubStringMatcher('if'))]]);
     $this->assertEquals($formatter->format($language->parse('if test')), KeyLighter::get()->highlight('if test', $language, $formatter));
 }
示例#2
0
 public function testReturnFQNWithEmbedded()
 {
     $language = new MockGreedyLanguage(['embedded' => [new MockGreedyLanguage([])]]);
     $this->assertSame('mock + mock', $language->getFQN());
 }