Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Add test for invalid, data-, and aria- attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Mar 5, 2015
1 parent 8ad7d2c commit 73262af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/AttributesTest.php
Expand Up @@ -238,4 +238,18 @@ public function testOmittingDefaultAttributes(): void {
$this->assertSame('mydefault', $x->:mystring);
$this->assertSame('<div>mydefault</div>', $x->toString());
}

/**
* @expectedException XHPAttributeNotSupportedException
*/
public function testBogusAttributes(): void {
$x = <test:default-attributes idonotexist="derp" />;
}

public function testSpecialAttributes(): void {
$x = <test:default-attributes data-idonotexist="derp" />;
$this->assertSame('<div>mydefault</div>', $x->toString());
$x = <test:default-attributes aria-idonotexist="derp" />;
$this->assertSame('<div>mydefault</div>', $x->toString());
}
}

0 comments on commit 73262af

Please sign in to comment.