Ejemplo n.º 1
0
 /**
  * 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]);
 }
Ejemplo n.º 2
0
 /**
  * Tests getting an instance of the log
  * @return void
  */
 public function testGetInstance()
 {
     $instance = Log::getInstance();
     $this->assertInstanceOf('\\Nimbles\\Core\\Log', $instance);
 }
Ejemplo n.º 3
0
 /**
  * Gets the object associated with this mixin
  * @return \Nimbles\Core\Log
  */
 public function getObject()
 {
     return Log::getInstance();
 }