@@ -50,9 +50,9 @@ public function testValidConstructor()
5050 $ this ->assertArrayHasKey ('items ' , $ data );
5151 $ this ->assertCount ($ this ->items_per_page , $ data ['items ' ]);
5252 $ 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 ' ]);
5656 }
5757
5858 /**
@@ -80,7 +80,7 @@ public function testCallbackDataParser()
8080 $ ikp = new InlineKeyboardPagination ($ this ->items , $ this ->command , $ this ->selected_page , $ this ->items_per_page );
8181 $ data = $ ikp ->getPagination ();
8282
83- $ callback_data = $ ikp ::getParametersFromCallbackData ($ data ['keyboard ' ][0 ][0 ][ 'callback_data ' ]);
83+ $ callback_data = $ ikp ::getParametersFromCallbackData ($ data ['keyboard ' ][0 ]['callback_data ' ]);
8484
8585 self ::assertSame ([
8686 'command ' => $ this ->command ,
@@ -130,41 +130,41 @@ public function testForceButtonsCount()
130130
131131 self ::assertAllButtonPropertiesEqual ([
132132 ['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '7 › ' , '10 » ' ],
133- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
133+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
134134
135135 self ::assertAllButtonPropertiesEqual ([
136136 ['« 1 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '10 » ' ],
137- ], 'text ' , $ ikp ->getPagination (5 )['keyboard ' ]);
137+ ], 'text ' , [ $ ikp ->getPagination (5 )['keyboard ' ] ]);
138138
139139 // testing with 8 fixed buttons
140140 $ ikp ->setMaxButtons (8 , true );
141141
142142 self ::assertAllButtonPropertiesEqual ([
143143 ['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '7 › ' , '10 » ' ],
144- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
144+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
145145
146146 self ::assertAllButtonPropertiesEqual ([
147147 ['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '7 › ' , '10 » ' ],
148- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
148+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
149149
150150 self ::assertAllButtonPropertiesEqual ([
151151 ['« 1 ' , '‹ 2 ' , '‹ 3 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '7 › ' , '10 » ' ],
152- ], 'text ' , $ ikp ->getPagination (5 )['keyboard ' ]);
152+ ], 'text ' , [ $ ikp ->getPagination (5 )['keyboard ' ] ]);
153153
154154 // testing with 7 fixed buttons
155155 $ ikp ->setMaxButtons (7 , true );
156156
157157 self ::assertAllButtonPropertiesEqual ([
158158 ['· 1 · ' , '2 ' , '3 ' , '4 › ' , '5 › ' , '6 › ' , '10 » ' ],
159- ], 'text ' , $ ikp ->getPagination (1 )['keyboard ' ]);
159+ ], 'text ' , [ $ ikp ->getPagination (1 )['keyboard ' ] ]);
160160
161161 self ::assertAllButtonPropertiesEqual ([
162162 ['« 1 ' , '‹ 3 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '7 › ' , '10 » ' ],
163- ], 'text ' , $ ikp ->getPagination (5 )['keyboard ' ]);
163+ ], 'text ' , [ $ ikp ->getPagination (5 )['keyboard ' ] ]);
164164
165165 self ::assertAllButtonPropertiesEqual ([
166166 ['« 1 ' , '‹ 5 ' , '‹ 6 ' , '‹ 7 ' , '8 ' , '9 ' , '· 10 · ' ],
167- ], 'text ' , $ ikp ->getPagination (10 )['keyboard ' ]);
167+ ], 'text ' , [ $ ikp ->getPagination (10 )['keyboard ' ] ]);
168168 }
169169
170170 /**
@@ -213,7 +213,7 @@ public function testButtonLabels()
213213 $ ikp10 = new InlineKeyboardPagination (range (1 , $ this ->items_per_page * 10 ), $ command , 1 , $ this ->items_per_page );
214214
215215 // current
216- $ keyboard = $ ikp1 ->getPagination (1 )['keyboard ' ];
216+ $ keyboard = [ $ ikp1 ->getPagination (1 )['keyboard ' ] ];
217217 self ::assertAllButtonPropertiesEqual ([
218218 ['· 1 · ' ],
219219 ], 'text ' , $ keyboard );
@@ -224,7 +224,7 @@ public function testButtonLabels()
224224 ], 'callback_data ' , $ keyboard );
225225
226226 // first, previous, current, next, last
227- $ keyboard = $ ikp10 ->getPagination (5 )['keyboard ' ];
227+ $ keyboard = [ $ ikp10 ->getPagination (5 )['keyboard ' ] ];
228228 self ::assertAllButtonPropertiesEqual ([
229229 ['« 1 ' , '‹ 4 ' , '· 5 · ' , '6 › ' , '10 » ' ],
230230 ], 'text ' , $ keyboard );
@@ -239,7 +239,7 @@ public function testButtonLabels()
239239 ], 'callback_data ' , $ keyboard );
240240
241241 // first, previous, current, last
242- $ keyboard = $ ikp10 ->getPagination (9 )['keyboard ' ];
242+ $ keyboard = [ $ ikp10 ->getPagination (9 )['keyboard ' ] ];
243243 self ::assertAllButtonPropertiesEqual ([
244244 ['« 1 ' , '‹ 7 ' , '8 ' , '· 9 · ' , '10 ' ],
245245 ], 'text ' , $ keyboard );
@@ -254,7 +254,7 @@ public function testButtonLabels()
254254 ], 'callback_data ' , $ keyboard );
255255
256256 // first, previous, current
257- $ keyboard = $ ikp10 ->getPagination (10 )['keyboard ' ];
257+ $ keyboard = [ $ ikp10 ->getPagination (10 )['keyboard ' ] ];
258258 self ::assertAllButtonPropertiesEqual ([
259259 ['« 1 ' , '‹ 7 ' , '8 ' , '9 ' , '· 10 · ' ],
260260 ], 'text ' , $ keyboard );
@@ -280,7 +280,7 @@ public function testButtonLabels()
280280 $ ikp10 ->setLabels ($ labels );
281281 self ::assertEquals ($ labels , $ ikp10 ->getLabels ());
282282
283- $ keyboard = $ ikp10 ->getPagination (5 )['keyboard ' ];
283+ $ keyboard = [ $ ikp10 ->getPagination (5 )['keyboard ' ] ];
284284 self ::assertAllButtonPropertiesEqual ([
285285 ['previous 4 ' , '6 next ' , 'last ' ],
286286 ], 'text ' , $ keyboard );
0 commit comments