dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.33k stars 1.25k forks source link

Route [name] not defined in PHPUnit #1685

Closed kadircanerergun closed 5 years ago

kadircanerergun commented 5 years ago
Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 5.5.x
PHP version 7.1.x

Actual Behaviour

I used route() helper method in my code to get named route url. But when i run php unit it says InvalidArgumentException : Route [name] not defined.

Should i set any configuration to fix this issue ?

specialtactics commented 5 years ago

I don't think you should be using that helper, as it uses the laravel router, and you need the dingo router. So you will want to use Dingo::route() . Note this depends on what is the name of the facade you are using for Dingo.

Also you may well need to update your dingo version, and potentially your laravel version.