Skip to content

Commit 2e97f85

Browse files
committed
fix testWriteTitleWithoutpageNumber
1 parent f6f65da commit 2e97f85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/PhpWordTests/Writer/Word2007/Element/TOCTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*
1616
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1717
*/
18+
1819
declare(strict_types=1);
1920

2021
namespace PhpOffice\PhpWordTests\Writer\Word2007\Element;
@@ -72,12 +73,12 @@ public function testWriteTitleWithoutpageNumber(): void
7273

7374
$doc = TestHelperDOCX::getDocument($phpWord);
7475

75-
for ($i = 1; $i <= 1; $i++) {
76+
for ($i = 1; $i <= 10; $i++) {
7677
self::assertTrue($doc->elementExists('/w:document/w:body/w:p[' . $i . ']/w:hyperlink/w:r[1]/w:t'));
7778
self::assertEquals('Title ' . $i, $doc->getElement('/w:document/w:body/w:p[' . $i . ']/w:hyperlink/w:r[1]/w:t')->textContent);
7879
self::assertTrue($doc->elementExists('/w:document/w:body/w:p[' . $i . ']/w:hyperlink/w:r[4]/w:instrText'));
7980
self::assertEquals('preserve', $doc->getElementAttribute('/w:document/w:body/w:p[' . $i . ']/w:hyperlink/w:r[4]/w:instrText', 'xml:space'));
80-
self::assertEquals('PAGEREF \\h', $doc->getElement('/w:document/w:body/w:p[' . $i . ']/w:hyperlink/w:r[4]/w:instrText')->nodeValue);
81+
self::assertEquals('PAGEREF ' . ($i - 1) . ' \\h', $doc->getElement('/w:document/w:body/w:p[' . $i . ']/w:hyperlink/w:r[4]/w:instrText')->nodeValue);
8182
}
8283
}
8384
}

0 commit comments

Comments
 (0)