Fix for Diactoros in legacy feature tests

This commit is contained in:
Igor Scheller 2018-01-19 23:19:50 +01:00
parent 3c08829205
commit 79e9714c74
4 changed files with 18 additions and 19 deletions

View File

@ -0,0 +1,14 @@
<?php
namespace Engelsystem\Test\Feature;
use PHPUnit\Framework\TestCase;
abstract class ApplicationFeatureTest extends TestCase
{
public static function setUpBeforeClass()
{
$_SERVER['HTTP_HOST'] = 'foo.bar';
require_once __DIR__ . '/../../includes/engelsystem.php';
}
}

View File

@ -3,18 +3,13 @@
namespace Engelsystem\Test\Feature\Logger; namespace Engelsystem\Test\Feature\Logger;
use Engelsystem\Logger\EngelsystemLogger; use Engelsystem\Logger\EngelsystemLogger;
use PHPUnit\Framework\TestCase; use Engelsystem\Test\Feature\ApplicationFeatureTest;
use Psr\Log\InvalidArgumentException; use Psr\Log\InvalidArgumentException;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
class EngelsystemLoggerTest extends TestCase class EngelsystemLoggerTest extends ApplicationFeatureTest
{ {
public static function setUpBeforeClass()
{
require_once __DIR__ . '/../../../includes/engelsystem.php';
}
/** /**
* @return LoggerInterface * @return LoggerInterface
*/ */

View File

@ -2,16 +2,11 @@
namespace Engelsystem\Test\Feature\Model; namespace Engelsystem\Test\Feature\Model;
use PHPUnit\Framework\TestCase; use Engelsystem\Test\Feature\ApplicationFeatureTest;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
class LogEntriesModelTest extends TestCase class LogEntriesModelTest extends ApplicationFeatureTest
{ {
public static function setUpBeforeClass()
{
require_once __DIR__ . '/../../../includes/engelsystem.php';
}
public function testCreateLogEntry() public function testCreateLogEntry()
{ {
LogEntries_clear_all(); LogEntries_clear_all();

View File

@ -8,11 +8,6 @@ class RoomModelTest extends TestCase
{ {
private $room_id = null; private $room_id = null;
public static function setUpBeforeClass()
{
require_once __DIR__ . '/../../../includes/engelsystem.php';
}
public function createRoom() public function createRoom()
{ {
$this->room_id = Room_create('test', false, null, null); $this->room_id = Room_create('test', false, null, null);