5

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

/v1/outlet/{outlet_id}/test


Route::get('outlets/{outlet_id}/test', ['as' => 'test'], function(){
    return app('request')->route('outlet_id');
});

It's working when i call it in postman or brower 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');
$this->assertResponseStatus(200);
Nonny PSK
  • 51
  • 4

2 Answers2

0

You have outlets plural in your test but outlet singular in your route definition.

FatBoyXPC
  • 861
  • 7
  • 15
-1

Please remove the code use WithoutMiddleware from your testing class if it is there and try.

Sandeep Sudhakaran
  • 1,072
  • 2
  • 9
  • 22