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.
39 lines
941 B
PHTML
39 lines
941 B
PHTML
10 years ago
|
<?php
|
||
7 years ago
|
|
||
8 years ago
|
namespace Engelsystem\Test;
|
||
|
|
||
7 years ago
|
use PHPUnit\Framework\TestCase;
|
||
|
use Psr\Log\LogLevel;
|
||
7 years ago
|
|
||
|
class LogEntriesModelTest extends TestCase
|
||
8 years ago
|
{
|
||
7 years ago
|
public static function setUpBeforeClass()
|
||
|
{
|
||
|
require_once __DIR__ . '/../../../includes/engelsystem_provider.php';
|
||
|
}
|
||
|
|
||
7 years ago
|
public function testCreateLogEntry()
|
||
8 years ago
|
{
|
||
7 years ago
|
LogEntries_clear_all();
|
||
8 years ago
|
$count = count(LogEntries());
|
||
7 years ago
|
$this->assertNotFalse(LogEntry_create(LogLevel::WARNING, 'test_LogEntry_create'));
|
||
|
|
||
8 years ago
|
// There should be one more log entry now
|
||
|
$this->assertEquals(count(LogEntries()), $count + 1);
|
||
8 years ago
|
}
|
||
10 years ago
|
|
||
7 years ago
|
public function testClearAllLogEntries()
|
||
8 years ago
|
{
|
||
7 years ago
|
LogEntry_create(LogLevel::WARNING, 'test');
|
||
8 years ago
|
$this->assertTrue(count(LogEntries()) > 0);
|
||
7 years ago
|
|
||
8 years ago
|
$this->assertNotFalse(LogEntries_clear_all());
|
||
7 years ago
|
$this->assertCount(0, LogEntries());
|
||
8 years ago
|
}
|
||
10 years ago
|
|
||
7 years ago
|
public function tearDown()
|
||
8 years ago
|
{
|
||
|
LogEntries_clear_all();
|
||
|
}
|
||
10 years ago
|
}
|