Passed
Push — master ( 5153a0...c7b3db )
by Josh
03:56
created

MockLensRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 25
ccs 11
cts 11
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A withFilters() 0 5 1
A withOrdering() 0 5 1
1
<?php
2
3
namespace JoshGaber\NovaUnit\Lenses;
4
5
use Laravel\Nova\Http\Requests\LensRequest;
6
7
class MockLensRequest extends LensRequest
8
{
9
    public $withFilters;
10
    public $withOrdering;
11
12 8
    public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
13
    {
14 8
        parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
15
16 8
        $this->withFilters = false;
17 8
        $this->withOrdering = false;
18 8
    }
19
20 2
    public function withFilters($query)
21
    {
22 2
        $this->withFilters = true;
23
24 2
        return $query;
25
    }
26
27 2
    public function withOrdering($query)
28
    {
29 2
        $this->withOrdering = true;
30
31 2
        return $query;
32
    }
33
}
34