@@ -9,7 +9,7 @@ class PaginatorTest extends TestCase
9
9
{
10
10
public function testSimplePaginatorReturnsRelevantContextInformation ()
11
11
{
12
- $ p = new Paginator ($ array = ['item3 ' , 'item4 ' , 'item5 ' ], 2 , 2 );
12
+ $ p = new Paginator (['item3 ' , 'item4 ' , 'item5 ' ], 2 , 2 );
13
13
14
14
$ this ->assertEquals (2 , $ p ->currentPage ());
15
15
$ this ->assertTrue ($ p ->hasPages ());
@@ -33,40 +33,35 @@ public function testSimplePaginatorReturnsRelevantContextInformation()
33
33
34
34
public function testPaginatorRemovesTrailingSlashes ()
35
35
{
36
- $ p = new Paginator ($ array = ['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 ,
37
- ['path ' => 'http://website.com/test/ ' ]);
36
+ $ p = new Paginator (['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 , ['path ' => 'http://website.com/test/ ' ]);
38
37
39
38
$ this ->assertSame ('http://website.com/test?page=1 ' , $ p ->previousPageUrl ());
40
39
}
41
40
42
41
public function testPaginatorGeneratesUrlsWithoutTrailingSlash ()
43
42
{
44
- $ p = new Paginator ($ array = ['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 ,
45
- ['path ' => 'http://website.com/test ' ]);
43
+ $ p = new Paginator (['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 , ['path ' => 'http://website.com/test ' ]);
46
44
47
45
$ this ->assertSame ('http://website.com/test?page=1 ' , $ p ->previousPageUrl ());
48
46
}
49
47
50
48
public function testItRetrievesThePaginatorOptions ()
51
49
{
52
- $ p = new Paginator ($ array = ['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 ,
53
- $ options = ['path ' => 'http://website.com/test ' ]);
50
+ $ p = new Paginator (['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 , ['path ' => 'http://website.com/test ' ]);
54
51
55
- $ this ->assertSame ($ p ->getOptions (), $ options );
52
+ $ this ->assertSame ([ ' path ' => ' http://website.com/test ' ], $ p ->getOptions ());
56
53
}
57
54
58
55
public function testPaginatorReturnsPath ()
59
56
{
60
- $ p = new Paginator ($ array = ['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 ,
61
- ['path ' => 'http://website.com/test ' ]);
57
+ $ p = new Paginator (['item1 ' , 'item2 ' , 'item3 ' ], 2 , 2 , ['path ' => 'http://website.com/test ' ]);
62
58
63
- $ this ->assertSame ($ p -> path (), 'http://website.com/test ' );
59
+ $ this ->assertSame ('http://website.com/test ' , $ p -> path () );
64
60
}
65
61
66
62
public function testCanTransformPaginatorItems ()
67
63
{
68
- $ p = new Paginator ($ array = ['item1 ' , 'item2 ' , 'item3 ' ], 3 , 1 ,
69
- ['path ' => 'http://website.com/test ' ]);
64
+ $ p = new Paginator (['item1 ' , 'item2 ' , 'item3 ' ], 3 , 1 , ['path ' => 'http://website.com/test ' ]);
70
65
71
66
$ p ->through (function ($ item ) {
72
67
return substr ($ item , 4 , 1 );
0 commit comments