run(); if (false === $process->isSuccessful()) { $this->markTestSkipped('Unable to create image fixture: '.$process->getErrorOutput()); } $sanitizedFilepath = $sanitizer->sanitizeFile($sourceFilepath, $targetFilepath, false); $this->assertSame($targetFilepath.'.pdf', $sanitizedFilepath); $this->assertFileExists($sanitizedFilepath); (new Filesystem())->remove([$sourceFilepath, $sanitizedFilepath]); } public function testAcceptsPdfs(): void { $tempDir = realpath(__DIR__.'/../../../temp'); $sourceFilepath = realpath(__DIR__.'/../../Resources/upload.pdf'); $targetFilepath = $tempDir.'/test.pdf'; $sanitizer = new Sanitizer('/usr/bin/gs', '/usr/bin/convert', $tempDir); $sanitizer->sanitizeFile($sourceFilepath, $targetFilepath, false); $this->assertFileExists($targetFilepath); (new Filesystem())->remove($targetFilepath); } }