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.
engelsystem/tests/Feature/Model/LogEntriesModelTest.php

39 lines
946 B
PHTML

<?php
namespace Engelsystem\Test\Feature\Model;
use PHPUnit\Framework\TestCase;
use Psr\Log\LogLevel;
class LogEntriesModelTest extends TestCase
8 years ago
{
public static function setUpBeforeClass()
{
require_once __DIR__ . '/../../../includes/engelsystem.php';
}
public function testCreateLogEntry()
8 years ago
{
LogEntries_clear_all();
8 years ago
$count = count(LogEntries());
$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
}
public function testClearAllLogEntries()
8 years ago
{
LogEntry_create(LogLevel::WARNING, 'test');
8 years ago
$this->assertTrue(count(LogEntries()) > 0);
8 years ago
$this->assertNotFalse(LogEntries_clear_all());
$this->assertCount(0, LogEntries());
8 years ago
}
public function tearDown()
8 years ago
{
LogEntries_clear_all();
}
}