Skip to content

Commit e21e006

Browse files
committed
Test enhancement
1 parent 114b913 commit e21e006

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

test/HTML5/Html5Test.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Html5Test extends TestCase
1111
*/
1212
private $html5;
1313

14-
public function setUp()
14+
protected function setUp()
1515
{
1616
$this->html5 = $this->getInstance();
1717
}
@@ -226,15 +226,15 @@ public function testConfig()
226226
{
227227
$html5 = $this->getInstance();
228228
$options = $html5->getOptions();
229-
$this->assertEquals(false, $options['encode_entities']);
229+
$this->assertFalse($options['encode_entities']);
230230

231231
$html5 = $this->getInstance(array(
232232
'foo' => 'bar',
233233
'encode_entities' => true,
234234
));
235235
$options = $html5->getOptions();
236236
$this->assertEquals('bar', $options['foo']);
237-
$this->assertEquals(true, $options['encode_entities']);
237+
$this->assertTrue($options['encode_entities']);
238238

239239
// Need to reset to original so future tests pass as expected.
240240
// $this->getInstance()->setOption('encode_entities', false);

test/HTML5/Parser/DOMTreeBuilderTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testBareAmpersand()
6262
{
6363
$html = "<!doctype html>
6464
<html>
65-
<body>
65+
<body>
6666
<img src='a&b' />
6767
<img src='a&=' />
6868
<img src='a&=c' />
@@ -74,7 +74,7 @@ public function testBareAmpersand()
7474
$this->assertEmpty($this->errors);
7575
$this->assertXmlStringEqualsXmlString('
7676
<!DOCTYPE html>
77-
<html xmlns="http://www.w3.org/1999/xhtml"><body>
77+
<html xmlns="http://www.w3.org/1999/xhtml"><body>
7878
<img src="a&amp;b"/>
7979
<img src="a&amp;="/>
8080
<img src="a&amp;=c"/>
@@ -97,7 +97,7 @@ public function testBareAmpersandNotAllowedInAttributes()
9797
$this->assertCount(2, $this->errors);
9898
$this->assertXmlStringEqualsXmlString('
9999
<!DOCTYPE html>
100-
<html xmlns="http://www.w3.org/1999/xhtml"><body>
100+
<html xmlns="http://www.w3.org/1999/xhtml"><body>
101101
<img src="a&amp;"/>
102102
<img src="a&amp;+"/>
103103
</body>
@@ -108,7 +108,7 @@ public function testBareAmpersandNotAllowedInBody()
108108
{
109109
$html = '<!doctype html>
110110
<html>
111-
<body>
111+
<body>
112112
a&b
113113
a&=
114114
a&=c
@@ -122,7 +122,7 @@ public function testBareAmpersandNotAllowedInBody()
122122
$this->assertCount(5, $this->errors);
123123
$this->assertXmlStringEqualsXmlString('
124124
<!DOCTYPE html>
125-
<html xmlns="http://www.w3.org/1999/xhtml"><body>
125+
<html xmlns="http://www.w3.org/1999/xhtml"><body>
126126
a&amp;b
127127
a&amp;=
128128
a&amp;=c
@@ -467,7 +467,7 @@ public function testParseErrors()
467467
// We're JUST testing that we can access errors. Actual testing of
468468
// error messages happen in the Tokenizer's tests.
469469
$this->assertGreaterThan(0, count($this->errors));
470-
$this->assertTrue(is_string($this->errors[0]));
470+
$this->assertInternalType('string', $this->errors[0]);
471471
}
472472

473473
public function testProcessingInstruction()

test/HTML5/Serializer/OutputRulesTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
2424
*/
2525
protected $html5;
2626

27-
public function setUp()
27+
protected function setUp()
2828
{
2929
$this->html5 = $this->getInstance();
3030
}
@@ -645,7 +645,7 @@ public function testHandlingInvalidRawContent()
645645

646646
$contents = $this->html5->saveHTML($dom);
647647

648-
$this->assertTrue(false !== strpos($contents, '<script id="template" type="x-tmpl-mustache">
648+
$this->assertGreaterThanOrEqual(0, strpos($contents, '<script id="template" type="x-tmpl-mustache">
649649
<h1>Hello!</h1>
650650
<p>Bar</p></script>'));
651651
}

test/HTML5/Serializer/TraverserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TraverserTest extends \Masterminds\HTML5\Tests\TestCase
1818
</body>
1919
</html>';
2020

21-
public function setUp()
21+
protected function setUp()
2222
{
2323
$this->html5 = $this->getInstance();
2424
}

0 commit comments

Comments
 (0)