diff --git a/tests/system/View/TableTest.php b/tests/system/View/TableTest.php index f4d7f4056f2d..ee1802b0725a 100644 --- a/tests/system/View/TableTest.php +++ b/tests/system/View/TableTest.php @@ -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 = ' + + + + +
BlueRedGreen
'; + $this->assertSame($expected, $this->table->generate()); + } + + // Utility Methods public function testPrepArgs(): void {