Completed
Pull Request — 5.1 (#1327)
by
unknown
05:23
created

paginateTest::testPaginatorRender()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
// +----------------------------------------------------------------------
1 ignored issue
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
3
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
4
// +----------------------------------------------------------------------
5
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
6
// +----------------------------------------------------------------------
7
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
// +----------------------------------------------------------------------
9
// | Author: yunwuxin <[email protected]>
10
// +----------------------------------------------------------------------
11
12
namespace tests\thinkphp\library\think;
13
14
use think\paginator\driver\Bootstrap;
0 ignored issues
show
Bug introduced by
The type think\paginator\driver\Bootstrap was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
class paginateTest extends \PHPUnit_Framework_TestCase
1 ignored issue
show
Bug introduced by
The type PHPUnit_Framework_TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Coding Style introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name must begin with a capital letter
Loading history...
17
{
18
    public function testPaginatorInfo()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
19
    {
20
        $p = Bootstrap::make($array = ['item3', 'item4'], 2, 2, 4);
21
22
        $this->assertEquals(4, $p->total());
23
24
        $this->assertEquals(2, $p->listRows());
25
26
        $this->assertEquals(2, $p->currentPage());
27
28
        $p2 = Bootstrap::make($array2 = ['item3', 'item4'], 2, 2, 2);
29
        $this->assertEquals(1, $p2->currentPage());
30
    }
31
32
    public function testPaginatorRender()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
33
    {
34
        $p      = Bootstrap::make($array = ['item3', 'item4'], 2, 2, 100);
35
        $render = '<ul class="pagination"><li><a href="/?page=1">&laquo;</a></li> <li><a href="/?page=1">1</a></li><li class="active"><span>2</span></li><li><a href="/?page=3">3</a></li><li><a href="/?page=4">4</a></li><li><a href="/?page=5">5</a></li><li><a href="/?page=6">6</a></li><li><a href="/?page=7">7</a></li><li><a href="/?page=8">8</a></li><li class="disabled"><span>...</span></li><li><a href="/?page=49">49</a></li><li><a href="/?page=50">50</a></li> <li><a href="/?page=3">&raquo;</a></li></ul>';
36
37
        $this->assertEquals($render, $p->render());
38
    }
39
40
}
41