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

testLoggerAdapterFileCreationWrite() public method

Tests the creation of the log file +w
Since: 2014-09-13
Author: Nikos Dimopoulos ([email protected])
    public function testLoggerAdapterFileCreationWrite()
    {
        $this->specify("logging in a file with write mode does not create the file", function () {
            $I = $this->tester;
            $fileName = $I->getNewFileName('log', 'log');
            $params = ['mode' => 'w'];
            $logger = new File($this->logPath . $fileName);
            $logger->log('Hello');
            $logger->close();
            $logger = new File($this->logPath . $fileName, $params);
            $logger->log('New Contents');
            $logger->close();
            $I->amInPath($this->logPath);
            $I->openFile($fileName);
            $I->seeInThisFile('New Contents');
            $I->deleteFile($fileName);
        });
    }
FileTest