mtas-tv-backend/test/AppTest/Handler/PingHandlerTest.php
2018-04-06 23:00:37 +02:00

27 lines
639 B
PHP

<?php
declare(strict_types=1);
namespace AppTest\Handler;
use App\Handler\PingHandler;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
class PingHandlerTest extends TestCase
{
public function testResponse()
{
$pingHandler = new PingHandler();
$response = $pingHandler->handle(
$this->prophesize(ServerRequestInterface::class)->reveal()
);
$json = json_decode((string) $response->getBody());
$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertTrue(isset($json->ack));
}
}