dingo / dingo/api

Issue Generating Url In Unit Test

Open
#1,375 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Im experiencing some issues trying to generate the url in my tests.

with the following code I got the error `Error: Call to a member function getByName() on null`

```
public function testApiIsConfirured()
{
$response = $this->json('GET',app('Dingo\Api\Routing\UrlGenerator')->version('v1')->route('api.index'));

$response->assertStatus(200);
}
```
When I tried it using the version helper i go the following error `ReflectionException: Class api.url does not exist`
```
public function testApiIsConfirured()
{
$response = $this->json('GET',version('v1')->route('api.index'));

$response->assertStatus(200);
}
```
Im using laravel:5.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.