Passed
Pull Request — master (#277)
by Kirill
03:11
created

PaginationTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testPaginateError() 0 5 1
A testPaginate() 0 5 1
A testPaginate2() 0 5 1
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Framework\Http;
13
14
use Spiral\Core\Exception\ScopeException;
15
use Spiral\Http\PaginationFactory;
16
use Spiral\Tests\Framework\HttpTest;
17
18
class PaginationTest extends HttpTest
19
{
20
    public function testPaginate(): void
21
    {
22
        $this->assertSame('1', (string)$this->get('/paginate', [
23
24
        ])->getBody());
25
    }
26
27
    public function testPaginateError(): void
28
    {
29
        $this->expectException(ScopeException::class);
30
31
        $this->app->get(PaginationFactory::class)->createPaginator('page');
32
    }
33
34
    public function testPaginate2(): void
35
    {
36
        $this->assertSame('2', (string)$this->get('/paginate', [
37
            'page' => 2
38
        ])->getBody());
39
    }
40
}
41