@@ -50,9 +50,9 @@ public function testValidConstructor()
50
50
$ this ->assertArrayHasKey ('items ' , $ data );
51
51
$ this ->assertCount ($ this ->items_per_page , $ data ['items ' ]);
52
52
$ this ->assertArrayHasKey ('keyboard ' , $ data );
53
- $ this ->assertArrayHasKey (0 , $ data ['keyboard ' ][ 0 ] );
54
- $ this ->assertArrayHasKey ('text ' , $ data ['keyboard ' ][0 ][ 0 ] );
55
- $ this ->assertStringStartsWith ("command= {$ this ->command }" , $ data ['keyboard ' ][0 ][0 ][ 'callback_data ' ]);
53
+ $ this ->assertArrayHasKey (0 , $ data ['keyboard ' ]);
54
+ $ this ->assertArrayHasKey ('text ' , $ data ['keyboard ' ][0 ]);
55
+ $ this ->assertStringStartsWith ("command= {$ this ->command }" , $ data ['keyboard ' ][0 ]['callback_data ' ]);
56
56
}
57
57
58
58
/**
@@ -80,7 +80,7 @@ public function testCallbackDataParser()
80
80
$ ikp = new InlineKeyboardPagination ($ this ->items , $ this ->command , $ this ->selected_page , $ this ->items_per_page );
81
81
$ data = $ ikp ->getPagination ();
82
82
83
- $ callback_data = $ ikp ::getParametersFromCallbackData ($ data ['keyboard ' ][0 ][0 ][ 'callback_data ' ]);
83
+ $ callback_data = $ ikp ::getParametersFromCallbackData ($ data ['keyboard ' ][0 ]['callback_data ' ]);
84
84
85
85
self ::assertSame ([
86
86
'command ' => $ this ->command ,
@@ -130,41 +130,41 @@ public function testForceButtonsCount()
130
130
131
131
self ::assertAllButtonPropertiesEqual ([
132
132
['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '7 › ' , '10 » ' ],
133
- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
133
+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
134
134
135
135
self ::assertAllButtonPropertiesEqual ([
136
136
['« 1 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '10 » ' ],
137
- ], 'text ' , $ ikp ->getPagination (5 )['keyboard ' ]);
137
+ ], 'text ' , [ $ ikp ->getPagination (5 )['keyboard ' ] ]);
138
138
139
139
// testing with 8 fixed buttons
140
140
$ ikp ->setMaxButtons (8 , true );
141
141
142
142
self ::assertAllButtonPropertiesEqual ([
143
143
['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '7 › ' , '10 » ' ],
144
- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
144
+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
145
145
146
146
self ::assertAllButtonPropertiesEqual ([
147
147
['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '7 › ' , '10 » ' ],
148
- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
148
+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
149
149
150
150
self ::assertAllButtonPropertiesEqual ([
151
151
['« 1 ' , '‹ 2 ' , '‹ 3 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '7 › ' , '10 » ' ],
152
- ], 'text ' , $ ikp ->getPagination (5 )['keyboard ' ]);
152
+ ], 'text ' , [ $ ikp ->getPagination (5 )['keyboard ' ] ]);
153
153
154
154
// testing with 7 fixed buttons
155
155
$ ikp ->setMaxButtons (7 , true );
156
156
157
157
self ::assertAllButtonPropertiesEqual ([
158
158
['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '10 » ' ],
159
- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
159
+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
160
160
161
161
self ::assertAllButtonPropertiesEqual ([
162
162
['« 1 ' , '‹ 3 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '7 › ' , '10 » ' ],
163
- ], 'text ' , $ ikp ->getPagination (5 )['keyboard ' ]);
163
+ ], 'text ' , [ $ ikp ->getPagination (5 )['keyboard ' ] ]);
164
164
165
165
self ::assertAllButtonPropertiesEqual ([
166
166
['« 1 ' , '‹ 5 ' , '‹ 6 ' , '‹ 7 ' , '8 ' , '9 ' , '· 10 · ' ],
167
- ], 'text ' , $ ikp ->getPagination (10 )['keyboard ' ]);
167
+ ], 'text ' , [ $ ikp ->getPagination (10 )['keyboard ' ] ]);
168
168
}
169
169
170
170
/**
@@ -213,7 +213,7 @@ public function testButtonLabels()
213
213
$ ikp10 = new InlineKeyboardPagination (range (1 , $ this ->items_per_page * 10 ), $ command , 1 , $ this ->items_per_page );
214
214
215
215
// current
216
- $ keyboard = $ ikp1 ->getPagination (1 )['keyboard ' ];
216
+ $ keyboard = [ $ ikp1 ->getPagination (1 )['keyboard ' ] ];
217
217
self ::assertAllButtonPropertiesEqual ([
218
218
['· 1 · ' ],
219
219
], 'text ' , $ keyboard );
@@ -224,7 +224,7 @@ public function testButtonLabels()
224
224
], 'callback_data ' , $ keyboard );
225
225
226
226
// first, previous, current, next, last
227
- $ keyboard = $ ikp10 ->getPagination (5 )['keyboard ' ];
227
+ $ keyboard = [ $ ikp10 ->getPagination (5 )['keyboard ' ] ];
228
228
self ::assertAllButtonPropertiesEqual ([
229
229
['« 1 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '10 » ' ],
230
230
], 'text ' , $ keyboard );
@@ -239,7 +239,7 @@ public function testButtonLabels()
239
239
], 'callback_data ' , $ keyboard );
240
240
241
241
// first, previous, current, last
242
- $ keyboard = $ ikp10 ->getPagination (9 )['keyboard ' ];
242
+ $ keyboard = [ $ ikp10 ->getPagination (9 )['keyboard ' ] ];
243
243
self ::assertAllButtonPropertiesEqual ([
244
244
['« 1 ' , '‹ 7 ' , '8 ' , '· 9 · ' , '10 ' ],
245
245
], 'text ' , $ keyboard );
@@ -254,7 +254,7 @@ public function testButtonLabels()
254
254
], 'callback_data ' , $ keyboard );
255
255
256
256
// first, previous, current
257
- $ keyboard = $ ikp10 ->getPagination (10 )['keyboard ' ];
257
+ $ keyboard = [ $ ikp10 ->getPagination (10 )['keyboard ' ] ];
258
258
self ::assertAllButtonPropertiesEqual ([
259
259
['« 1 ' , '‹ 7 ' , '8 ' , '9 ' , '· 10 · ' ],
260
260
], 'text ' , $ keyboard );
@@ -280,7 +280,7 @@ public function testButtonLabels()
280
280
$ ikp10 ->setLabels ($ labels );
281
281
self ::assertEquals ($ labels , $ ikp10 ->getLabels ());
282
282
283
- $ keyboard = $ ikp10 ->getPagination (5 )['keyboard ' ];
283
+ $ keyboard = [ $ ikp10 ->getPagination (5 )['keyboard ' ] ];
284
284
self ::assertAllButtonPropertiesEqual ([
285
285
['previous 4 ' , '6 next ' , 'last ' ],
286
286
], 'text ' , $ keyboard );
0 commit comments