testCallSameControllerWithParams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nip\Controllers\Tests\Traits;
4
5
use Nip\Controllers\Tests\AbstractTest;
6
use Nip\Controllers\Tests\Fixtures\Controllers\BaseControllerWithUtilityMethods;
7
use Nip\Request;
8
9
/**
10
 * Class DispatchAwareTraitTest
11
 * @package Nip\Controllers\Tests\Traits
12
 */
13
class DispatchAwareTraitTest extends AbstractTest
14
{
15
    public function testCallSameControllerWithEmptyParams()
16
    {
17
        $controller = new BaseControllerWithUtilityMethods();
18
        $controller->setRequest(new Request());
0 ignored issues
show
Deprecated Code introduced by
The class Nip\Request has been deprecated: use \Nip\Http\Request ( Ignorable by Annotation )

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

18
        $controller->setRequest(/** @scrutinizer ignore-deprecated */ new Request());
Loading history...
19
20
        $response = $controller->call('hello');
21
        static::assertSame('hello', $response);
22
    }
23
24
    public function testCallSameControllerWithParams()
25
    {
26
        $controller = new BaseControllerWithUtilityMethods();
27
        $controller->setRequest(new Request());
0 ignored issues
show
Deprecated Code introduced by
The class Nip\Request has been deprecated: use \Nip\Http\Request ( Ignorable by Annotation )

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

27
        $controller->setRequest(/** @scrutinizer ignore-deprecated */ new Request());
Loading history...
28
29
        $response = $controller->call('hello', ['John']);
30
        static::assertSame('hello John', $response);
31
    }
32
}
33