1212
1313class URLImageTest extends TestCase
1414{
15- // https://github.com/readthedocs/readthedocs.org/issues/11615
16- public function xtestURLImageSource (): void
15+ public function testURLImageSource (): void
1716 {
1817 if (getenv ('SKIP_URL_IMAGE_TEST ' ) === '1 ' ) {
1918 self ::markTestSkipped ('Skipped due to setting of environment variable ' );
@@ -31,20 +30,14 @@ public function xtestURLImageSource(): void
3130 // Check if the source is a URL or a file path
3231 self ::assertTrue ($ drawing ->getIsURL ());
3332 self ::assertSame ('https://phpspreadsheet.readthedocs.io/en/latest/topics/images/01-03-filter-icon-1.png ' , $ drawing ->getPath ());
34- $ imageContents = file_get_contents ($ drawing ->getPath ());
35- self ::assertNotFalse ($ imageContents );
36- $ filePath = tempnam (sys_get_temp_dir (), 'Drawing ' );
37- self ::assertNotFalse ($ filePath );
38- self ::assertNotFalse (file_put_contents ($ filePath , $ imageContents ));
39- $ mimeType = mime_content_type ($ filePath );
40- unlink ($ filePath );
41- self ::assertNotFalse ($ mimeType );
42- $ extension = File::mime2ext ($ mimeType );
43- self ::assertSame ('png ' , $ extension );
33+ self ::assertSame (IMAGETYPE_PNG , $ drawing ->getType ());
34+ self ::assertSame (84 , $ drawing ->getWidth ());
35+ self ::assertSame (44 , $ drawing ->getHeight ());
4436 }
37+ $ spreadsheet ->disconnectWorksheets ();
4538 }
4639
47- public function xtestURLImageSourceNotFound (): void
40+ public function testURLImageSourceNotFound (): void
4841 {
4942 if (getenv ('SKIP_URL_IMAGE_TEST ' ) === '1 ' ) {
5043 self ::markTestSkipped ('Skipped due to setting of environment variable ' );
@@ -56,6 +49,7 @@ public function xtestURLImageSourceNotFound(): void
5649 $ worksheet = $ spreadsheet ->getActiveSheet ();
5750 $ collection = $ worksheet ->getDrawingCollection ();
5851 self ::assertCount (0 , $ collection );
52+ $ spreadsheet ->disconnectWorksheets ();
5953 }
6054
6155 public function testURLImageSourceBadProtocol (): void
0 commit comments