Skip to content

Commit

Permalink
test: add missing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Dec 22, 2023
1 parent 8b56aad commit 0b8c4fd
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/system/View/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,24 @@ public function testAddRow(): void
);
}

// Uility Methods
public function testAddRowAndRowWithAttributes(): void
{
$cell = ['data' => 'Blue', 'class' => 'highlight', 'colspan' => 2];
$this->table->addRow($cell, 'Red', 'Green');
// If there is only one column `$this->table->addRow($cell)`,
// this test will fail.
// See https://github.com/codeigniter4/CodeIgniter4/issues/8361

$expected = '<table border="0" cellpadding="4" cellspacing="0">
<tbody>
<tr>
<td colspan="2" class="highlight">Blue</td><td>Red</td><td>Green</td></tr>
</tbody>
</table>';
$this->assertSame($expected, $this->table->generate());
}

// Utility Methods

public function testPrepArgs(): void
{
Expand Down

0 comments on commit 0b8c4fd

Please sign in to comment.