2015-06-06 10:21:36 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2015-06-06 10:21:36 -04:00
|
|
|
/**
|
2024-05-10 09:09:14 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-06-06 10:21:36 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Test\Preview;
|
|
|
|
|
|
2026-01-27 17:42:02 -05:00
|
|
|
use OC\BinaryFinder;
|
2025-06-12 12:31:58 -04:00
|
|
|
use OC\Preview\Postscript;
|
|
|
|
|
|
2025-10-20 19:52:40 -04:00
|
|
|
#[\PHPUnit\Framework\Attributes\Group('DB')]
|
2026-01-27 17:42:02 -05:00
|
|
|
#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('imagick')]
|
|
|
|
|
class PostscriptTest extends Provider {
|
|
|
|
|
|
2019-11-27 09:27:18 -05:00
|
|
|
protected function setUp(): void {
|
2026-01-27 17:42:02 -05:00
|
|
|
if (\Imagick::queryFormats('EPS') === false || \Imagick::queryFormats('PS') === false) {
|
|
|
|
|
$this->markTestSkipped('Imagick does not support postscript.');
|
|
|
|
|
}
|
|
|
|
|
if (\OCP\Server::get(BinaryFinder::class)->findBinaryPath('gs') === false) {
|
|
|
|
|
// Imagick forwards postscript rendering to Ghostscript but does not report this in queryFormats
|
|
|
|
|
$this->markTestSkipped('Ghostscript is not installed.');
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-06 10:21:36 -04:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
|
|
$fileName = 'testimage.eps';
|
|
|
|
|
$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
|
|
|
|
|
$this->width = 2400;
|
|
|
|
|
$this->height = 1707;
|
2025-06-12 12:31:58 -04:00
|
|
|
$this->provider = new Postscript;
|
2015-06-06 10:21:36 -04:00
|
|
|
}
|
|
|
|
|
}
|