* uplift to latest expressive

This commit is contained in:
Danyi Dávid
2017-11-06 13:18:39 +01:00
parent b5c307166e
commit 8c5b58acd1
44 changed files with 3419 additions and 1022 deletions

View File

@@ -3,20 +3,24 @@
namespace AppTest\Action;
use App\Action\PingAction;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequest;
use Interop\Http\ServerMiddleware\DelegateInterface;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
class PingActionTest extends \PHPUnit_Framework_TestCase
class PingActionTest extends TestCase
{
public function testResponse()
{
$pingAction = new PingAction();
$response = $pingAction(new ServerRequest(['/']), new Response(), function () {
});
$response = $pingAction->process(
$this->prophesize(ServerRequestInterface::class)->reveal(),
$this->prophesize(DelegateInterface::class)->reveal()
);
$json = json_decode((string) $response->getBody());
$this->assertTrue($response instanceof Response);
$this->assertTrue($response instanceof Response\JsonResponse);
$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertTrue(isset($json->ack));
}
}