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

logging() protected method

Runs logging test
Since: 2012-09-17
Author: Nikos Dimopoulos ([email protected])
protected logging ( $function )
$function
    protected function logging($function)
    {
        $I = $this->tester;
        $fileName = $I->getNewFileName('log', 'log');
        $logger = new File($this->logPath . $fileName);
        $logger->{$function}('Hello');
        $logger->close();
        $I->amInPath($this->logPath);
        $contents = \file($this->logPath . $fileName);
        $I->deleteFile($fileName);
        $position = strpos($contents[0], '[' . strtoupper($function) . ']');
        $actual = $position !== false;
        expect($actual)->true();
        $position = strpos($contents[0], 'Hello');
        $actual = $position !== false;
        expect($actual)->true();
    }
FileTest