예제 #1
0
 public function testSetAndGet()
 {
     $this->setValuesToMessage($this->message);
     $this->assertEquals('facility', $this->message->getFacility());
     $this->assertEquals('foo.php', $this->message->getFile());
     $this->assertEquals('Full Message', $this->message->getFullMessage());
     $this->assertEquals('example.com', $this->message->getHost());
     $this->assertEquals(3, $this->message->getLevel());
     $this->assertEquals(42, $this->message->getLine());
     $this->assertEquals('Short Message', $this->message->getShortMessage());
     $this->assertEquals(123456789, $this->message->getTimestamp());
     $this->assertEquals('1.2.3', $this->message->getVersion());
 }
예제 #2
0
 public function testSetTimestamp()
 {
     $dt = new \DateTime('@1393661544.3012');
     $this->message->setTimestamp($dt);
     $this->assertEquals($dt->format("U.u"), $this->message->getTimestamp());
 }