/** * Tests the loggable mixin methods * @return void */ public function testMixinMethods() { $instance = Log::getInstance(); $writer = new Log\Writer\Mock(array('formatter' => array('simple' => array('format' => '%category% - %message%')))); $instance->writers->mock = $writer; $loggable = new LoggableMock(); $loggable->log('Hello world'); $loggable->log(new Log\Entry(array('message' => 'Hello world', 'category' => 'test'))); $entries = $writer->getEntries(); $this->assertEquals('uncategorised - Hello world', $entries[0]); $this->assertEquals('test - Hello world', $entries[1]); }
/** * Tests getting an instance of the log * @return void */ public function testGetInstance() { $instance = Log::getInstance(); $this->assertInstanceOf('\\Nimbles\\Core\\Log', $instance); }
/** * Gets the object associated with this mixin * @return \Nimbles\Core\Log */ public function getObject() { return Log::getInstance(); }