Skip to content

Commit

Permalink
Issue #14: Finish the TableSectionTest::testRegularTable() test.
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Oct 27, 2024
1 parent 7ab7103 commit a41349d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/src/TableSectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
namespace Donquixote\Cellbrush\Tests;

use Donquixote\Cellbrush\Axis\DynamicAxis;
use Donquixote\Cellbrush\Html\Multiple\StaticAttributesMap;
use Donquixote\Cellbrush\TSection\TableSection;

class TableSectionTest extends \PHPUnit_Framework_TestCase {

function testRegularTable() {
$columns = new DynamicAxis();
$columns->addNames(['c0', 'c1', 'c2']);
$tsection = new TableSection($columns);
$tsection = new TableSection('tbody');
$tsection->addRow('r0')
->td('c0', '00')
->td('c1', '01')
Expand All @@ -21,7 +22,17 @@ function testRegularTable() {
->td('c1', '11')
->td('c2', '12')
;
# print_r($tsection->getRawMatrix($columns->takeSnapshot()));
$tableColAttributes = StaticAttributesMap::create([], []);
$output = $tsection->render($columns->takeSnapshot(), $tableColAttributes);
$this->assertSame(
<<<'EOT'
<tbody>
<tr><td>00</td><td>01</td><td>02</td></tr>
<tr><td>10</td><td>11</td><td>12</td></tr>
</tbody>

EOT,
$output);
}

}

0 comments on commit a41349d

Please sign in to comment.