stringValidator = TestEnvironment::newValidatorFactory()->newStringValidator(); } public function testBuildHTML() { $instance = new SummaryTable( [ 'Foo' => 'Bar' ] ); $this->stringValidator->assertThatStringContains( [ '
', '
Foo
', '
Bar
' ], $instance->buildHTML() ); } public function testBuildHTML_SetAttributes() { $instance = new SummaryTable( [ 'Foo' => 'Bar' ] ); $instance->setAttributes( [ 'Foo' => [ 'style' => 'display:none;' ] ] ); $this->stringValidator->assertThatStringContains( [ '
', '
' ], $instance->buildHTML() ); } public function testBuildHTML_ColumnThreshold() { $instance = new SummaryTable( [ 'Foo' => 'Bar', 'Foobar' => 'Bar' ] ); $instance->setColumnThreshold( 1 ); $this->stringValidator->assertThatStringContains( [ '
', '
', '
Foo
', '
Bar
', '
', '
Foobar
', '
Bar
' ], $instance->buildHTML( [ 'columns' => 2 ] ) ); } public function testBuildHTML_ColumnThreshold_NoImage() { $instance = new SummaryTable( [ 'Foo' => 'Bar', 'Foobar' => 'Bar' ] ); $instance->noImage(); $instance->setColumnThreshold( 1 ); $this->stringValidator->assertThatStringContains( [ '
', '
', '
Foo
Bar
', '
Foobar
Bar
', '
' ], $instance->buildHTML( [ 'columns' => 2 ] ) ); } }