stringValidator = TestEnvironment::newValidatorFactory()->newStringValidator(); } public function testStandardTable_Cell_Row() { $instance = new HtmlTable(); $instance->cell( 'Foo', [ 'rel' => 'some' ] ); $instance->row( [ 'class' => 'bar' ] ); $this->stringValidator->assertThatStringContains( '
Foo
', $instance->table() ); } public function testStandardTable_Header_Cell_Row() { $instance = new HtmlTable(); $instance->header( 'Foo ' ); $instance->cell( 'Bar' ); $instance->row(); $this->stringValidator->assertThatStringContains( '
Foo
Bar
', $instance->table() ); } public function testStandardTable_Header_Cell_Row_IsHtml() { $instance = new HtmlTable(); $instance->header( 'Foo' ); $instance->cell( 'Bar' ); $instance->row(); $this->stringValidator->assertThatStringContains( '
Foo
Bar
', $instance->table( [], false, true ) ); } public function testTransposedTable_Cell_Row() { $instance = new HtmlTable(); // We need a dedicated header definition to support a table transpose $instance->header( 'Foo' ); $instance->header( 'Bar' ); $instance->cell( 'lala', [ 'class' => 'foo' ] ); $instance->row(); $instance->cell( 'lula', [ 'rel' => 'tuuu' ] ); $instance->cell( 'lila' ); $instance->row(); $this->stringValidator->assertThatStringContains( [ '', '', '
Foolalalula
Barlila
' ], $instance->table( [], true ) ); } public function testTransposedTable_Cell_Row_IsHtml() { $instance = new HtmlTable(); // We need a dedicated header definition to support a table transpose $instance->header( 'Foo' ); $instance->header( 'Bar' ); $instance->cell( 'lala', [ 'class' => 'foo' ] ); $instance->row(); $instance->cell( 'lula', [ 'rel' => 'tuuu' ] ); $instance->cell( 'lila' ); $instance->row(); $this->stringValidator->assertThatStringContains( [ '', '', '
Foolalalula
Barlila
' ], $instance->table( [], true, true ) ); } }