forked from cidilabs/phpally
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectInterfaceIsAccessibleTest.php
More file actions
26 lines (21 loc) · 1.08 KB
/
ObjectInterfaceIsAccessibleTest.php
File metadata and controls
26 lines (21 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
use CidiLabs\PhpAlly\Rule\ObjectInterfaceIsAccessible;
class ObjectInterfaceIsAccessibleTest extends PhpAllyTestCase {
public function testCheckOne()
{
$html = '<div><object type="application/pdf"data="/media/examples/In-CC0.pdf"width="250"height="200">Media Application</object></div>';
$dom = new \DOMDocument('1.0', 'utf-8');
$dom->loadHTML($html);
$rule = new ObjectInterfaceIsAccessible($dom);
$this->assertEquals(1, $rule->check(), 'Object Interface Is Accessible should have no issues.');
}
public function testCheckTwo()
{
$html = '<div><object type="application/pdf"data="/media/examples/In-CC0.pdf"width="250"height="200"></object></div>';
$html .= '<div><object type="application/pdf"data="/media/examples/In-CC0.pdf"width="250"height="200"></object></div>';
$dom = new \DOMDocument('1.0', 'utf-8');
$dom->loadHTML($html);
$rule = new ObjectInterfaceIsAccessible($dom);
$this->assertEquals(2, $rule->check(), 'Object Interface Is Accessible should have one issue.');
}
}