예제 #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());
 }