예제 #1
0
 public function testTimestamp()
 {
     $this->assertFalse($this->logger->usesTimeStamp());
     $this->logger->enableTimestamp();
     $this->assertTrue($this->logger->usesTimeStamp());
     $this->logger->disableTimestamp();
     $this->assertFalse($this->logger->usesTimeStamp());
     $this->assertEquals('D M j G:i:s.u T Y', $this->logger->getTimestampFormat());
     $this->logger->setTimestampFormat('D M j G:i:s.u Y');
     $this->assertEquals('D M j G:i:s.u Y', $this->logger->getTimestampFormat());
     $this->logger->setTimestampFormat('D M j G:i:s.u T Y');
     $this->assertTrue(date_create_from_format('D M j G:i:s.u T Y', $this->logger->createTimeStamp(), $this->logger->getTimezone()) instanceof \DateTime);
     $this->setExpectedException('Piton\\Exceptions\\InvalidArgumentException');
     $this->logger->setTimestampFormat([]);
 }