Initial commit
This commit is contained in:
26
test/AppTest/Action/PingActionTest.php
Normal file
26
test/AppTest/Action/PingActionTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace AppTest\Action;
|
||||
|
||||
use App\Action\PingAction;
|
||||
use Interop\Http\ServerMiddleware\DelegateInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user