/** * @test */ public function it_fires_single_event_when_word_is_not_parsed() { $this->clearLog(); $limelight = new Limelight(); $limelight->dispatcher()->addListeners(['Limelight\\Tests\\Stubs\\TestListener'], 'WordWasCreated'); $results = $limelight->parse('ケータイ'); $log = $this->readLog(); $this->assertEquals('WordWasCreated fired. ケータイ', $log); $this->clearLog(); $limelight->dispatcher()->clearListeners(); }
/** * @test */ public function it_turns_events_back_on_after_running_noparse_with_event_supression() { $this->clearLog(); $limelight = new Limelight(); $limelight->dispatcher()->addListeners(['Limelight\\Tests\\Stubs\\TestListener'], 'WordWasCreated'); $results = $limelight->noParse('できるかな。。。', ['Romaji'], true); $log = $this->readLog(); $this->assertEquals('', $log); $results = $limelight->parse('出来るかな。'); $log = $this->readLog(); $this->assertEquals('WordWasCreated fired. 出来るWordWasCreated fired. かWordWasCreated fired. なWordWasCreated fired. 。', $log); $this->clearLog(); $limelight->dispatcher()->clearListeners(); }