sms-store/test/AppTest/Action/PingActionTest.php

27 lines
730 B
PHP
Raw Normal View History

2017-09-03 17:51:59 +02:00
<?php
namespace AppTest\Action;
use App\Action\PingAction;
use Interop\Http\ServerMiddleware\DelegateInterface;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ServerRequestInterface;
2020-09-07 20:54:56 +02:00
use Laminas\Diactoros\Response\JsonResponse;
2017-09-03 17:51:59 +02:00
class PingActionTest extends TestCase
{
public function testResponse()
{
$pingAction = new PingAction();
$response = $pingAction->process(
$this->prophesize(ServerRequestInterface::class)->reveal(),
$this->prophesize(DelegateInterface::class)->reveal()
);
$json = json_decode((string) $response->getBody());
$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertTrue(isset($json->ack));
}
}