laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 419 forks source link

Route parameters return null on unittest #885

Closed ivybridge-3c33 closed 5 years ago

ivybridge-3c33 commented 5 years ago

Description:

I got a problem on phpunit I'm design route as

/v1/outlet/{outlet_id}/test

$router->get('v1/outlets/{outlet_id}/test', function(){ return app('request')->route('outlet_id'); });

It's working when i call it in postman or browser but in phpunit show out as error

Call to a member function parameter() on array test code

$req = $this->call('GET', '/v1/outlets/1/test'); dump($req->getContent()); $this->assertResponseStatus(200);

driesvints commented 5 years ago

I just tagged Lumen v5.7.8 which should fix this. Can you upgrade and try again?

ivybridge-3c33 commented 5 years ago

@driesvints Thank you