Skip to content

Commit d9165f0

Browse files
authored
Merge pull request #1513 from carusogabriel/phpunit
Use dedicated PHPUnit assertions
2 parents 9dd5e0c + 663fb03 commit d9165f0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/PhpWord/Writer/HTML/ElementTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public function testWriteTrackChanges()
7373
$dom = $this->getAsHTML($phpWord);
7474
$xpath = new \DOMXPath($dom);
7575

76-
$this->assertTrue($xpath->query('/html/body/p[1]/ins')->length == 1);
77-
$this->assertTrue($xpath->query('/html/body/p[2]/del')->length == 1);
76+
$this->assertEquals(1, $xpath->query('/html/body/p[1]/ins')->length);
77+
$this->assertEquals(1, $xpath->query('/html/body/p[2]/del')->length);
7878
}
7979

8080
/**
@@ -97,9 +97,9 @@ public function testWriteColSpan()
9797
$dom = $this->getAsHTML($phpWord);
9898
$xpath = new \DOMXPath($dom);
9999

100-
$this->assertTrue($xpath->query('/html/body/table/tr[1]/td')->length == 1);
100+
$this->assertEquals(1, $xpath->query('/html/body/table/tr[1]/td')->length);
101101
$this->assertEquals('2', $xpath->query('/html/body/table/tr/td[1]')->item(0)->attributes->getNamedItem('colspan')->textContent);
102-
$this->assertTrue($xpath->query('/html/body/table/tr[2]/td')->length == 2);
102+
$this->assertEquals(2, $xpath->query('/html/body/table/tr[2]/td')->length);
103103
}
104104

105105
/**
@@ -126,9 +126,9 @@ public function testWriteRowSpan()
126126
$dom = $this->getAsHTML($phpWord);
127127
$xpath = new \DOMXPath($dom);
128128

129-
$this->assertTrue($xpath->query('/html/body/table/tr[1]/td')->length == 2);
129+
$this->assertEquals(2, $xpath->query('/html/body/table/tr[1]/td')->length);
130130
$this->assertEquals('3', $xpath->query('/html/body/table/tr[1]/td[1]')->item(0)->attributes->getNamedItem('rowspan')->textContent);
131-
$this->assertTrue($xpath->query('/html/body/table/tr[2]/td')->length == 1);
131+
$this->assertEquals(1, $xpath->query('/html/body/table/tr[2]/td')->length);
132132
}
133133

134134
private function getAsHTML(PhpWord $phpWord)
@@ -155,7 +155,7 @@ public function testWriteTitleTextRun()
155155
$htmlWriter = new HTML($phpWord);
156156
$content = $htmlWriter->getContent();
157157

158-
$this->assertTrue(strpos($content, $expected) !== false);
158+
$this->assertContains($expected, $content);
159159
}
160160

161161
/**

0 commit comments

Comments
 (0)