Test Failed
Push — master ( d8d5ef...b9f7fc )
by mcfog
01:56
created

testFixedResponseMiddleware()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php namespace Nimo\Tests;
2
3
/**
4
 * User: mcfog
5
 * Date: 15/9/13
6
 */
7
8
use Nimo\Middlewares\FixedResponseMiddleware;
9
10
class FixedResponseMiddlewareTest extends NimoTestCase
11
{
12
    public function testFixedResponseMiddleware()
13
    {
14
        $answerRes = $this->getResponseMock();
15
        /** @noinspection PhpParamsInspection */
16
        $middleware = new FixedResponseMiddleware($answerRes);
0 ignored issues
show
Documentation introduced by
$answerRes is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Psr\Http\Message\ResponseInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
17
18
        $returnValue = $middleware->process(
19
            $this->getRequestMock(),
0 ignored issues
show
Documentation introduced by
$this->getRequestMock() is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Psr\Http\Message\ServerRequestInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
20
            $this->throwHandler()
21
        );
22
23
        $this->assertSame($answerRes, $returnValue);
24
    }
25
26
27
}
28