Closed PedroPMS closed 3 years ago
@PedroPMS Did you have a solution for this?
protected function createRequest(
string $method,
string $path,
string $query = "",
array $headers = ['HTTP_ACCEPT' => 'application/json'],
array $cookies = [],
array $serverParams = []
): Request {
$uri = new Uri('', '', 80, $path, $query);
$handle = fopen('php://temp', 'w+');
$stream = (new StreamFactory())->createStreamFromResource($handle);
$h = new Headers();
foreach ($headers as $name => $value) {
$h->addHeader($name, $value);
}
return new SlimRequest($method, $uri, $h, $cookies, $serverParams, $stream);
}
I updated the TestCase class method createRequest to accept the query.
I'm trying to test a route with query params but it's not working
This is returning Not Fund, how can I test this route?