HtmlTest::testSanitize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
namespace Redaxscript\Tests\Filter;
3
4
use Redaxscript\Filter;
5
use Redaxscript\Tests\TestCaseAbstract;
6
7
/**
8
 * HtmlTest
9
 *
10
 * @since 2.2.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Henry Ruhs
15
 *
16
 * @covers Redaxscript\Filter\Html
17
 */
18
19
class HtmlTest extends TestCaseAbstract
20
{
21
	/**
22
	 * setUp
23
	 *
24
	 * @since 3.1.0
25
	 */
26
27
	public function setUp() : void
28
	{
29
		parent::setUp();
30
		$optionArray = $this->getOptionArray();
31
		$installer = $this->installerFactory();
32
		$installer->init();
33
		$installer->rawCreate();
34
		$installer->insertSettings($optionArray);
35
	}
36
37
	/**
38
	 * tearDown
39
	 *
40
	 * @since 3.1.0
41
	 */
42
43
	public function tearDown() : void
44
	{
45
		$this->dropDatabase();
46
	}
47
48
	/**
49
	 * testSanitize
50
	 *
51
	 * @since 2.2.0
52
	 *
53
	 * @param string $html
54
	 * @param string $expect
55
	 *
56
	 * @dataProvider providerAutoloader
57
	 */
58
59
	public function testSanitize(string $html = null, string $expect = null) : void
60
	{
61
		/* setup */
62
63
		$filter = new Filter\Html();
64
65
		/* actual */
66
67
		$actual = $filter->sanitize($html);
68
69
		/* compare */
70
71
		$this->assertSame($expect, $actual);
72
	}
73
}
74