Metrics: Added controller feature test

This commit is contained in:
Igor Scheller 2020-01-02 14:14:03 +01:00
parent d27bcabc8b
commit 74cf8d1e69
3 changed files with 27 additions and 3 deletions

View File

@ -9,6 +9,6 @@ abstract class ApplicationFeatureTest extends TestCase
public static function setUpBeforeClass(): void
{
$_SERVER['HTTP_HOST'] = 'foo.bar';
require_once __DIR__ . '/../../includes/engelsystem.php';
require __DIR__ . '/../../includes/engelsystem.php';
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace Engelsystem\Test\Feature\Controllers\Metrics;
use Engelsystem\Controllers\Metrics\Controller;
use Engelsystem\Test\Feature\ApplicationFeatureTest;
class ControllerTest extends ApplicationFeatureTest
{
/**
* @covers \Engelsystem\Controllers\Metrics\Controller::metrics
*/
public function testMetrics()
{
config(['api_key' => null]);
/** @var Controller $controller */
$controller = app()->make(Controller::class);
$response = $controller->metrics();
$this->assertEquals(200, $response->getStatusCode());
}
}

View File

@ -2,10 +2,11 @@
namespace Engelsystem\Test\Feature\Model;
use PHPUnit\Framework\TestCase;
use Engelsystem\Test\Feature\ApplicationFeatureTest;
class RoomModelTest extends TestCase
class RoomModelTest extends ApplicationFeatureTest
{
/** @var int */
private $room_id = null;
/**