0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-20 13:10:13 +00:00
nextcloud_server/tests/lib/Preview/OfficeTest.php
Ferdinand Thiessen 494a079321
test: replace OC_Helper:rmdirr with OCP\Files::rmdirr
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-16 23:09:37 +02:00

38 lines
1,020 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace Test\Preview;
use OCP\IBinaryFinder;
use OCP\Server;
/**
* Class OfficeTest
*
* @group DB
*
* @package Test\Preview
*/
class OfficeTest extends Provider {
protected function setUp(): void {
$binaryFinder = Server::get(IBinaryFinder::class);
$libreofficeBinary = $binaryFinder->findBinaryPath('libreoffice');
$openofficeBinary = $libreofficeBinary === false ? $binaryFinder->findBinaryPath('openoffice') : false;
if ($libreofficeBinary !== false || $openofficeBinary !== false) {
parent::setUp();
$fileName = 'testimage.odt';
$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
$this->width = 595;
$this->height = 842;
$this->provider = new \OC\Preview\OpenDocument;
} else {
$this->markTestSkipped('No Office provider present');
}
}
}