Phalcon\Test\Unit\Logger\Adapter\FileTest::testLoggerAdapterFileNumberOfMessagesLogged PHP Method

testLoggerAdapterFileNumberOfMessagesLogged() public method

Tests how many lines the file has on creation
Since: 2014-09-13
Author: Nikos Dimopoulos ([email protected])
    public function testLoggerAdapterFileNumberOfMessagesLogged()
    {
        $this->specify("Log does not contain correct number of messages", function () {
            $I = $this->tester;
            $fileName = $I->getNewFileName('log', 'log');
            $logger = new File($this->logPath . $fileName);
            $logger->log('Hello');
            $logger->log('Goodbye');
            $logger->close();
            $I->amInPath($this->logPath);
            $I->openFile($fileName);
            $expected = sprintf("[%s][DEBUG] Hello\n[%s][DEBUG] Goodbye", date('D, d M y H:i:s O'), date('D, d M y H:i:s O'));
            $I->seeInThisFile($expected);
            $I->deleteFile($fileName);
        });
    }
FileTest