@@ -39,6 +39,11 @@ public function tearDown()
39
39
parent ::tearDown ();
40
40
}
41
41
42
+ /**
43
+ * Test that a non API or paginated request returns null.
44
+ *
45
+ * @return void
46
+ */
42
47
public function testNonApiPaginatedRequest ()
43
48
{
44
49
$ controller = new ArticlesController ($ this ->request , $ this ->response );
@@ -48,6 +53,12 @@ public function testNonApiPaginatedRequest()
48
53
$ this ->assertNull ($ apiPaginationComponent ->beforeRender ($ event ));
49
54
}
50
55
56
+ /**
57
+ * Test the expected pagination information for the component's default
58
+ * config.
59
+ *
60
+ * @return void
61
+ */
51
62
public function testDefaultPaginationSettings ()
52
63
{
53
64
$ this ->request ->env ('HTTP_ACCEPT ' , 'application/json ' );
@@ -77,6 +88,11 @@ public function testDefaultPaginationSettings()
77
88
$ this ->assertSame ($ expected , $ result );
78
89
}
79
90
91
+ /**
92
+ * Test that visibility-only correctly sets the visible keys.
93
+ *
94
+ * @return void
95
+ */
80
96
public function testVisibilitySettings ()
81
97
{
82
98
$ this ->request ->env ('HTTP_ACCEPT ' , 'application/json ' );
@@ -108,6 +124,11 @@ public function testVisibilitySettings()
108
124
$ this ->assertSame ($ expected , $ result );
109
125
}
110
126
127
+ /**
128
+ * Test that alias-only correctly sets aliases the keys.
129
+ *
130
+ * @return void
131
+ */
111
132
public function testAliasSettings ()
112
133
{
113
134
$ this ->request ->env ('HTTP_ACCEPT ' , 'application/json ' );
@@ -143,6 +164,11 @@ public function testAliasSettings()
143
164
$ this ->assertSame ($ expected , $ result );
144
165
}
145
166
167
+ /**
168
+ * Test that key-only correctly sets the pagination key.
169
+ *
170
+ * @return void
171
+ */
146
172
public function testKeySetting ()
147
173
{
148
174
$ this ->request ->env ('HTTP_ACCEPT ' , 'application/json ' );
@@ -174,6 +200,11 @@ public function testKeySetting()
174
200
$ this ->assertSame ($ expected , $ result );
175
201
}
176
202
203
+ /**
204
+ * Test that all settings being used together work correctly.
205
+ *
206
+ * @return void
207
+ */
177
208
public function testAllSettings ()
178
209
{
179
210
$ this ->request ->env ('HTTP_ACCEPT ' , 'application/json ' );
0 commit comments