File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,24 @@ public function testAddRow(): void
173173 );
174174 }
175175
176- // Uility Methods
176+ public function testAddRowAndRowWithAttributes (): void
177+ {
178+ $ cell = ['data ' => 'Blue ' , 'class ' => 'highlight ' , 'colspan ' => 2 ];
179+ $ this ->table ->addRow ($ cell , 'Red ' , 'Green ' );
180+ // If there is only one column `$this->table->addRow($cell)`,
181+ // this test will fail.
182+ // See https://github.com/codeigniter4/CodeIgniter4/issues/8361
183+
184+ $ expected = '<table border="0" cellpadding="4" cellspacing="0">
185+ <tbody>
186+ <tr>
187+ <td colspan="2" class="highlight">Blue</td><td>Red</td><td>Green</td></tr>
188+ </tbody>
189+ </table> ' ;
190+ $ this ->assertSame ($ expected , $ this ->table ->generate ());
191+ }
192+
193+ // Utility Methods
177194
178195 public function testPrepArgs (): void
179196 {
You can’t perform that action at this time.
0 commit comments