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 55use Cake \Controller \ComponentRegistry ;
66use Cake \Controller \Controller ;
77use Cake \Core \Plugin ;
8+ use Cake \Event \Event ;
89use Cake \Network \Request ;
910use Cake \Network \Response ;
1011use Cake \TestSuite \TestCase ;
@@ -32,26 +33,16 @@ public function setUp()
3233 public function tearDown ()
3334 {
3435 parent ::tearDown ();
35-
36- unset($ this ->component , $ this ->controller );
3736 }
3837
39- public function testInit ()
38+ public function testNonApiPaginatedRequest ()
4039 {
4140 $ request = new Request ('/ ' );
4241 $ response = $ this ->getMock ('Cake\Network\Response ' );
43-
4442 $ 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 );
5445
55- $ this ->assertSame ( $ expected , $ result );
46+ $ this ->assertNull ( $ apiPaginationComponent -> beforeRender ( $ event ) );
5647 }
5748}
You can’t perform that action at this time.
0 commit comments