assertInstanceof( HtmlBuilder::class, new HtmlBuilder() ); } /** * @dataProvider buildParamsProvider */ public function testBuild( $key, $params ) { $instance = new HtmlBuilder(); $this->assertIsString( $instance->build( $key, $params ) ); } public function buildParamsProvider() { yield [ 'schema_head', [ 'link' => 'Foo', 'description' => 'bar', 'schema-title' => '...', 'summary-title' => '...', 'schema_summary' => '...', 'error' => 'err---rr', 'error-title' => 'error', 'usage_count' => 42, 'usage-title' => 'usage', 'usage' => '...', 'schema_body' => '...' ] ]; yield [ 'schema_body', [ 'text' => 'Foo', 'unknown_type' => 'bar', 'isYaml' => false ] ]; yield [ 'schema_error_text', [ 'list' => [], 'schema' => 'Foo' ] ]; yield [ 'schema_error', [ 'text' => '...', 'msg' => 'Foo' ] ]; yield [ 'schema_footer', [ 'href_type' => '...', 'link_type' => 'Foo', 'msg_type' => 'Bar', 'tags' => [], 'href_tag' => 'Foobar' ] ]; yield [ 'schema_unknown_type', [ 'msg' => 'Foo' ] ]; yield [ 'schema_help_link', [ 'href' => 'Foo' ] ]; } }