mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 09:13:11 +08:00
Removed everything that was deprecated
This commit is contained in:
@@ -78,35 +78,6 @@ class BodyParserMiddlewareTest extends TestCase
|
||||
$test = $this;
|
||||
$body = new Stream('php://temp', 'wr');
|
||||
$body->write('{"foo": "bar", "bar": ["one", 5]}');
|
||||
$request = (new ServerRequest())->withMethod('PUT')
|
||||
->withBody($body)
|
||||
->withHeader('content-type', 'application/json');
|
||||
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
||||
$process = $delegate->handle(Argument::type(ServerRequestInterface::class))->will(
|
||||
function (array $args) use ($test) {
|
||||
/** @var ServerRequestInterface $req */
|
||||
$req = array_shift($args);
|
||||
|
||||
$test->assertEquals([
|
||||
'foo' => 'bar',
|
||||
'bar' => ['one', 5],
|
||||
], $req->getParsedBody());
|
||||
|
||||
return new Response();
|
||||
},
|
||||
);
|
||||
|
||||
$this->middleware->process($request, $delegate->reveal());
|
||||
|
||||
$process->shouldHaveBeenCalledOnce();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function regularRequestsAreUrlDecoded(): void
|
||||
{
|
||||
$test = $this;
|
||||
$body = new Stream('php://temp', 'wr');
|
||||
$body->write('foo=bar&bar[]=one&bar[]=5');
|
||||
$request = (new ServerRequest())->withMethod('PUT')
|
||||
->withBody($body);
|
||||
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
||||
|
||||
Reference in New Issue
Block a user