summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a166e50)
Change-Id: I3c50ea56721226ddb37bcf4778a7d71e9b56d0f7
*/
class HtmlArmorTest extends PHPUnit_Framework_TestCase {
*/
class HtmlArmorTest extends PHPUnit_Framework_TestCase {
- public static function provideHtmlArmor() {
+ public static function provideConstructor() {
+ return [
+ [ 'test' ],
+ [ null ],
+ [ '<em>some html!</em>' ]
+ ];
+ }
+
+ /**
+ * @dataProvider provideConstructor
+ */
+ public function testConstructor( $value ) {
+ $this->assertInstanceOf( HtmlArmor::class, new HtmlArmor( $value ) );
+ }
+
+ public static function provideGetHtml() {
new HtmlArmor( '<script>alert("evil!");</script>' ),
'<script>alert("evil!");</script>',
],
new HtmlArmor( '<script>alert("evil!");</script>' ),
'<script>alert("evil!");</script>',
],
+ [
+ new HtmlArmor( null ),
+ null,
+ ]
- * @dataProvider provideHtmlArmor
+ * @dataProvider provideGetHtml
- public function testHtmlArmor( $input, $expected ) {
+ public function testGetHtml( $input, $expected ) {
$this->assertEquals(
$expected,
HtmlArmor::getHtml( $input )
$this->assertEquals(
$expected,
HtmlArmor::getHtml( $input )