RestApiTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 5
c 1
b 1
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testStore() 0 7 1
1
<?php
2
3
namespace Crystoline\LaraRestApi\Tests;
4
5
use Tests\TestCase;
0 ignored issues
show
Bug introduced by
The type Tests\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Foundation\Testing\RefreshDatabase;
0 ignored issues
show
Bug introduced by
The type Illuminate\Foundation\Testing\RefreshDatabase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class RestApiTest extends TestCase
9
{
10
    use RefreshDatabase;
11
    /**
12
     * A basic test example.
13
     *
14
     * @return void
15
     */
16
    public function testStore()
17
    {
18
        $response = $this-action('POST', 'Crystoline\LaraRestApiTestController@yourAction', ['links' => 'link1 \n link2']);
0 ignored issues
show
Bug introduced by
The function action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        $response = $this-/** @scrutinizer ignore-call */ action('POST', 'Crystoline\LaraRestApiTestController@yourAction', ['links' => 'link1 \n link2']);
Loading history...
19
        // you can check if response was ok
20
        $this->assertTrue($response->isOk(), "Custom message if something went wrong");
0 ignored issues
show
Bug introduced by
The method isOk() does not exist on integer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        $this->assertTrue($response->/** @scrutinizer ignore-call */ isOk(), "Custom message if something went wrong");

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
        // or if view received variable
22
        $this->assertViewHas('links', ['link1', 'link2']);
23
    }
24
}
25