77
88class SvgImageTest extends TestCase
99{
10- private string $ svgPath ;
1110
1211 protected function setUp (): void
1312 {
14- $ this -> svgPath = __DIR__ . '/../_files/images/sample.svg ' ;
15- if (!file_exists ($ this -> svgPath )) {
16- $ this ->markTestSkipped ('SVG file not found: ' . $ this -> svgPath );
13+ $ svgPath = __DIR__ . '/../_files/images/sample.svg ' ;
14+ if (!file_exists ($ svgPath )) {
15+ $ this ->markTestSkipped ('SVG file not found: ' . $ svgPath );
1716 }
1817 }
1918
2019 public function testAddSvgImageWithoutStyles (): void
2120 {
21+ $ svgPath = __DIR__ . '/../_files/images/sample.svg ' ;
2222 $ phpWord = new PhpWord ();
2323 $ section = $ phpWord ->addSection ();
24- $ image = $ section ->addImage ($ this -> svgPath );
24+ $ image = $ section ->addImage ($ svgPath );
2525
26- $ this ->assertEquals ($ this -> svgPath , $ image ->getSource ());
26+ $ this ->assertEquals ($ svgPath , $ image ->getSource ());
2727 $ this ->assertEquals ('image/svg+xml ' , $ image ->getImageType ());
2828 }
2929
3030 public function testAddSvgImageWithStyles (): void
3131 {
32+ $ svgPath = __DIR__ . '/../_files/images/sample.svg ' ;
3233 $ phpWord = new PhpWord ();
3334 $ section = $ phpWord ->addSection ();
3435 $ options = [
@@ -37,7 +38,7 @@ public function testAddSvgImageWithStyles(): void
3738 'wrappingStyle ' => Image::WRAPPING_STYLE_BEHIND ,
3839 ];
3940
40- $ image = $ section ->addImage ($ this -> svgPath , $ options );
41+ $ image = $ section ->addImage ($ svgPath , $ options );
4142
4243 $ this ->assertEquals (200 , $ image ->getStyle ()->getWidth ());
4344 $ this ->assertEquals (200 , $ image ->getStyle ()->getHeight ());
0 commit comments