Phalcon\Test\Unit\Logger\Formatter\LineTest::testLoggerFormatterLineNewFormatLogsCorrectly PHP Метод

testLoggerFormatterLineNewFormatLogsCorrectly() публичный Метод

Tests new format logs correctly
С версии: 2012-09-17
Автор: Nikos Dimopoulos ([email protected])
    public function testLoggerFormatterLineNewFormatLogsCorrectly()
    {
        $this->specify("Line formatted does not set format correctly", function () {
            $I = $this->tester;
            $fileName = $I->getNewFileName('log', 'log');
            $logger = new File($this->logPath . $fileName);
            $formatter = new Line('%type%|%date%|%message%');
            $logger->setFormatter($formatter);
            $logger->log('Hello');
            $logger->close();
            $I->amInPath($this->logPath);
            $I->openFile($fileName);
            $I->seeInThisFile(sprintf('DEBUG|%s|Hello', date('D, d M y H:i:s O')));
            $I->deleteFile($fileName);
        });
    }