Completed
Push — develop ( 917ef4...9bd229 )
by Christoffer
11:11 queued 08:28
created

FractalMiddlewareTest::setup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Nord\Lumen\Fractal\Tests;
4
5
use Illuminate\Http\Request;
6
use Nord\Lumen\Fractal\FractalService;
7
use Nord\Lumen\Fractal\FractalMiddleware;
8
9
class FractalMiddlewareTest extends \Codeception\Test\Unit
10
{
11
    use \Codeception\Specify;
12
13
    /**
14
     * @var FractalService
15
     */
16
    private $service;
17
18
    /**
19
     * @var FractalMiddleware
20
     */
21
    private $middleware;
22
23
    /**
24
     * @inheritdoc
25
     */
26
    protected function setup()
27
    {
28
        $this->service    = new FractalService();
29
        $this->middleware = new FractalMiddleware($this->service);
30
    }
31
32
    /**
33
     *
34
     */
35
    public function testAssertParseInclude()
36
    {
37
        $this->specify('verify middleware parse include', function () {
38
            $req = new Request();
39
            $req->offsetSet('include', 'foo,bar,baz');
40
41
            verify($this->middleware->handle($req, function () {
42
                return true;
43
            }))->equals(true);
44
        });
45
    }
46
}
47