* @copyright Meritoo */ class InvalidHtmlAttributesExceptionTest extends BaseTestCase { public function testConstructorVisibilityAndArguments() { static::assertConstructorVisibilityAndArguments(InvalidHtmlAttributesException::class, OopVisibilityType::IS_PUBLIC, 3); } /** * @param string $htmlAttributes Invalid html attributes * @param string $expectedMessage Expected exception's message * * @dataProvider provideHtmlAttributes */ public function testConstructorMessage($htmlAttributes, $expectedMessage) { $exception = InvalidHtmlAttributesException::create($htmlAttributes); static::assertEquals($expectedMessage, $exception->getMessage()); } /** * Provides html attributes * * @return Generator */ public function provideHtmlAttributes() { $template = 'HTML attributes \'%s\' are invalid. Is there everything ok?'; yield[ 'abc = def', sprintf($template, 'abc = def'), ]; yield[ 'abc = def ghi = jkl', sprintf($template, 'abc = def ghi = jkl'), ]; yield[ 'abc=def ghi=jkl', sprintf($template, 'abc=def ghi=jkl'), ]; } }