File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change 5
5
use Cake \Controller \ComponentRegistry ;
6
6
use Cake \Controller \Controller ;
7
7
use Cake \Core \Plugin ;
8
+ use Cake \Event \Event ;
8
9
use Cake \Network \Request ;
9
10
use Cake \Network \Response ;
10
11
use Cake \TestSuite \TestCase ;
@@ -32,26 +33,16 @@ public function setUp()
32
33
public function tearDown ()
33
34
{
34
35
parent ::tearDown ();
35
-
36
- unset($ this ->component , $ this ->controller );
37
36
}
38
37
39
- public function testInit ()
38
+ public function testNonApiPaginatedRequest ()
40
39
{
41
40
$ request = new Request ('/ ' );
42
41
$ response = $ this ->getMock ('Cake\Network\Response ' );
43
-
44
42
$ controller = new Controller ($ request , $ response );
45
- $ controller ->loadComponent ('BryanCrowe/ApiPagination.ApiPagination ' );
46
-
47
- $ expected = [
48
- 'key ' => 'pagination ' ,
49
- 'aliases ' => [],
50
- 'visible ' => []
51
- ];
52
-
53
- $ result = $ controller ->ApiPagination ->config ();
43
+ $ apiPaginationComponent = new ApiPaginationComponent ($ controller ->components ());
44
+ $ event = new Event ('Controller.beforeRender ' , $ controller );
54
45
55
- $ this ->assertSame ( $ expected , $ result );
46
+ $ this ->assertNull ( $ apiPaginationComponent -> beforeRender ( $ event ) );
56
47
}
57
48
}
You can’t perform that action at this time.
0 commit comments