Fix for Diactoros in legacy feature tests

main
Igor Scheller 7 years ago
parent 3c08829205
commit 79e9714c74

@ -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';
}
}

@ -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
*/ */

@ -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();

@ -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);

Loading…
Cancel
Save