-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible with Lumen 6 under PHP 7.2 #20
Comments
I've overwritten this fellow methods on my TestCase, and now the lumen-testing seems to work with lumen 6: /**
* Call the given URI and return the Response.
*
* @param string $method
* @param string $uri
* @param array $parameters
* @param array $cookies
* @param array $files
* @param array $server
* @param string $content
* @return \Illuminate\Http\Response
*/
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
{
$this->currentUri = $this->prepareUrlForRequest($uri);
$symfonyRequest = SymfonyRequest::create(
$this->currentUri, $method, $parameters,
$cookies, $files, $server, $content
);
$this->app['request'] = LumenRequest::createFromBase($symfonyRequest);
return $this->response = $this->createTestResponse(
$this->app->prepareResponse($this->app->handle($this->app['request']))
);
}
/**
* Extract the file uploads from the given data array.
*
* @param array $data
* @return array
*/
protected function extractFilesFromDataArray(&$data)
{
$files = [];
foreach ($data as $key => $value) {
if ($value instanceof SymfonyUploadedFile) {
$files[$key] = $value;
unset($data[$key]);
}
if (is_array($value)) {
$files[$key] = $this->extractFilesFromDataArray($value);
if (!empty($files[$key])) {
unset($data[$key]);
}
$data[$key] = $value;
}
}
return $files;
} |
I think this is the same as Issue #13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I try to use the package with Lumen 6 and PHP 7.2 and this not work.
The request does not pass the values.
The text was updated successfully, but these errors were encountered: