Skip to content

Commit 17da32f

Browse files
committed
Fix: update XML assertion for scripts and correct image path retrieval
1 parent cbfc565 commit 17da32f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

tests/PhpWordTests/Writer/WPS/Part/ContentTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testWrite(): void
3232
self::assertStringContainsString('xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"', $result);
3333
self::assertStringContainsString('xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"', $result);
3434
self::assertStringContainsString('xmlns:xlink="http://www.w3.org/1999/xlink"', $result);
35-
self::assertStringContainsString('<office:scripts>', $result);
35+
self::assertStringContainsString('<office:scripts/>', $result);
3636
self::assertStringContainsString('<office:font-face-decls>', $result);
3737
self::assertStringContainsString('<style:font-face style:name="Arial" svg:font-family="Arial"', $result);
3838
self::assertStringContainsString('<office:automatic-styles>', $result);

tests/PhpWordTests/Writer/WPSTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ public function testWithMedia(): void
6464
$section = $phpWord->addSection();
6565

6666
// Add an image to the document
67-
// Correct the relative path and check if realpath returns a valid path
68-
$imagePath = realpath(__DIR__ . 'tests/PhpWordTests/_files/images/earth.jpg');
67+
$imagePath = realpath('tests/PhpWordTests/_files/images/earth.jpg');
6968
self::assertIsString($imagePath, 'Test image file not found or accessible at the expected location.'); // Ensure path is valid string
7069
self::assertFileExists($imagePath, "Test image file not found at: {$imagePath}"); // Use validated path
7170
$section->addImage($imagePath); // Use validated path

0 commit comments

Comments
 (0)