1010
1111class URLImageTest extends TestCase
1212{
13- // https://github.com/readthedocs/readthedocs.org/issues/11615
14- public function xtestURLImageSource (): void
13+ public function testURLImageSource (): void
1514 {
1615 if (getenv ('SKIP_URL_IMAGE_TEST ' ) === '1 ' ) {
1716 self ::markTestSkipped ('Skipped due to setting of environment variable ' );
@@ -29,20 +28,14 @@ public function xtestURLImageSource(): void
2928 // Check if the source is a URL or a file path
3029 self ::assertTrue ($ drawing ->getIsURL ());
3130 self ::assertSame ('https://phpspreadsheet.readthedocs.io/en/latest/topics/images/01-03-filter-icon-1.png ' , $ drawing ->getPath ());
32- $ imageContents = file_get_contents ($ drawing ->getPath ());
33- self ::assertNotFalse ($ imageContents );
34- $ filePath = tempnam (sys_get_temp_dir (), 'Drawing ' );
35- self ::assertNotFalse ($ filePath );
36- self ::assertNotFalse (file_put_contents ($ filePath , $ imageContents ));
37- $ mimeType = mime_content_type ($ filePath );
38- unlink ($ filePath );
39- self ::assertNotFalse ($ mimeType );
40- $ extension = File::mime2ext ($ mimeType );
41- self ::assertSame ('png ' , $ extension );
31+ self ::assertSame (IMAGETYPE_PNG , $ drawing ->getType ());
32+ self ::assertSame (84 , $ drawing ->getWidth ());
33+ self ::assertSame (44 , $ drawing ->getHeight ());
4234 }
35+ $ spreadsheet ->disconnectWorksheets ();
4336 }
4437
45- public function xtestURLImageSourceNotFound (): void
38+ public function testURLImageSourceNotFound (): void
4639 {
4740 if (getenv ('SKIP_URL_IMAGE_TEST ' ) === '1 ' ) {
4841 self ::markTestSkipped ('Skipped due to setting of environment variable ' );
@@ -54,6 +47,7 @@ public function xtestURLImageSourceNotFound(): void
5447 $ worksheet = $ spreadsheet ->getActiveSheet ();
5548 $ collection = $ worksheet ->getDrawingCollection ();
5649 self ::assertCount (0 , $ collection );
50+ $ spreadsheet ->disconnectWorksheets ();
5751 }
5852
5953 public function testURLImageSourceBadProtocol (): void
0 commit comments