Skip to content

Commit 6f4abae

Browse files
committed
Add docblocks to tests
1 parent e913370 commit 6f4abae

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/TestCase/Controller/Component/ApiPaginationComponentTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ public function tearDown()
3939
parent::tearDown();
4040
}
4141

42+
/**
43+
* Test that a non API or paginated request returns null.
44+
*
45+
* @return void
46+
*/
4247
public function testNonApiPaginatedRequest()
4348
{
4449
$controller = new ArticlesController($this->request, $this->response);
@@ -48,6 +53,12 @@ public function testNonApiPaginatedRequest()
4853
$this->assertNull($apiPaginationComponent->beforeRender($event));
4954
}
5055

56+
/**
57+
* Test the expected pagination information for the component's default
58+
* config.
59+
*
60+
* @return void
61+
*/
5162
public function testDefaultPaginationSettings()
5263
{
5364
$this->request->env('HTTP_ACCEPT', 'application/json');
@@ -77,6 +88,11 @@ public function testDefaultPaginationSettings()
7788
$this->assertSame($expected, $result);
7889
}
7990

91+
/**
92+
* Test that visibility-only correctly sets the visible keys.
93+
*
94+
* @return void
95+
*/
8096
public function testVisibilitySettings()
8197
{
8298
$this->request->env('HTTP_ACCEPT', 'application/json');
@@ -108,6 +124,11 @@ public function testVisibilitySettings()
108124
$this->assertSame($expected, $result);
109125
}
110126

127+
/**
128+
* Test that alias-only correctly sets aliases the keys.
129+
*
130+
* @return void
131+
*/
111132
public function testAliasSettings()
112133
{
113134
$this->request->env('HTTP_ACCEPT', 'application/json');
@@ -143,6 +164,11 @@ public function testAliasSettings()
143164
$this->assertSame($expected, $result);
144165
}
145166

167+
/**
168+
* Test that key-only correctly sets the pagination key.
169+
*
170+
* @return void
171+
*/
146172
public function testKeySetting()
147173
{
148174
$this->request->env('HTTP_ACCEPT', 'application/json');
@@ -174,6 +200,11 @@ public function testKeySetting()
174200
$this->assertSame($expected, $result);
175201
}
176202

203+
/**
204+
* Test that all settings being used together work correctly.
205+
*
206+
* @return void
207+
*/
177208
public function testAllSettings()
178209
{
179210
$this->request->env('HTTP_ACCEPT', 'application/json');

0 commit comments

Comments
 (0)