You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.6 KiB
PHP
68 lines
1.6 KiB
PHP
<?php
|
|
namespace BSR\Utils\Logger;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class LoggerTest extends TestCase{
|
|
|
|
public function setUp()
|
|
{
|
|
Logger::start(array());
|
|
}
|
|
|
|
public function tearDown()
|
|
{
|
|
|
|
}
|
|
|
|
public function testStartReturnsDefault()
|
|
{
|
|
$this->assertEquals(is_array(Logger::data()),true);
|
|
}
|
|
|
|
public function testInfoWithKeyParamOverwritesDataKeyValue()
|
|
{
|
|
}
|
|
|
|
public function testInfoWithoutKeyParamAndIntKeysGetRenumberedAndDontOverwrite()
|
|
{
|
|
}
|
|
|
|
public function testLogDoesNotLogMessagesAccordingToVerbosityParamWhenSmallerThanConfig()
|
|
{
|
|
}
|
|
|
|
public function testLogLogsMessagesWhenVerbosityParamIsGreaterThanConfigVerbosity()
|
|
{
|
|
}
|
|
|
|
public function testStopComputesElapsedTimeProperly()
|
|
{
|
|
}
|
|
|
|
public function testStopDoesNotLogAnythingWhenConfigVerbosityIsQuiet()
|
|
{
|
|
$this->assertEquals(Configuration::get('log.verbosity'), Logger::QUIET);
|
|
}
|
|
|
|
public function testStopSavesLogFileWhenConfigVerbosityIsNotQuiet()
|
|
{
|
|
$this->assertNotEquals(Configuration::get('log.verbosity'), Logger::QUIET);
|
|
$this->assertNotEquals('No log yet !', Logger::getLastLogs());
|
|
}
|
|
|
|
public function testDataReturnsArray()
|
|
{
|
|
$this->assertEquals(is_array(Logger::data()), true);
|
|
}
|
|
|
|
public function testGetLastLogsReturnsNoLogsWhenNoFileWithConfigLogFileNameExists()
|
|
{
|
|
$this->assertEquals('No log yet !', Logger::getLastLogs());
|
|
}
|
|
|
|
public function testGetLastLogsReturnsALogBufferWhenFileWithConfigLogFileNameExists()
|
|
{
|
|
}
|
|
}
|