@@ -687,12 +687,15 @@ public function testPatternStreamResourcesParseGradientAndImageDoTokens(): void
687687 $ outfont = new \Com \Tecnick \Pdf \Font \Output ($ font ->getFonts (), $ pon , $ encrypt );
688688 $ this ->setObjectProperty ($ obj , 'outfont ' , $ outfont );
689689
690- // Register a gradient shader to ensure gradient resources are available.
691- $ graph ->getAlpha ( 0.8 );
692- $ graph ->getStopTransform ();
690+ $ graph -> getLinearGradient ( 0.0 , 0.0 , 10.0 , 10.0 , ' red ' , ' blue ' );
691+ $ graph ->getOutGradientShaders ( $ pon );
692+ $ gradientId = $ graph ->getLastGradientID ();
693693
694- $ out = $ obj -> exposeGetPatternStreamResourceDict ( ' /Sh9 sh /I2 Do ' );
694+ $ this -> assertNotNull ( $ gradientId );
695695
696+ $ out = $ obj ->exposeGetPatternStreamResourceDict ('/Sh ' . $ gradientId . ' sh /I2 Do ' );
697+
698+ $ this ->assertStringContainsString (' /Pattern << ' , $ out );
696699 $ this ->assertStringContainsString (' /XObject << ' , $ out );
697700 }
698701
@@ -3871,7 +3874,7 @@ public function testGetOutEmbeddedFilesSkipsUnreadableSourceFiles(): void
38713874 $ throwingFile = new class () extends \Com \Tecnick \File \File {
38723875 public function fileGetContents (string $ path ): string
38733876 {
3874- throw new \Com \Tecnick \Pdf \Exception ('mock unreadable file ' );
3877+ throw new \Com \Tecnick \Pdf \Exception ('mock unreadable file: ' . $ path );
38753878 }
38763879 };
38773880 $ this ->setObjectProperty ($ obj , 'file ' , $ throwingFile );
0 commit comments