From 0b8c4fd3f01c1fff46bf47ee7ce8528f8073a0a5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 23 Dec 2023 07:42:46 +0900 Subject: [PATCH] test: add missing test case --- tests/system/View/TableTest.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 {