Metrics: Added controller feature test

main
Igor Scheller 5 years ago
parent d27bcabc8b
commit 74cf8d1e69

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

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

@ -2,10 +2,11 @@
namespace Engelsystem\Test\Feature\Model; 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; private $room_id = null;
/** /**

Loading…
Cancel
Save