OfficeTest.php 892 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace Test\Preview;
  8. /**
  9. * Class OfficeTest
  10. *
  11. * @group DB
  12. *
  13. * @package Test\Preview
  14. */
  15. class OfficeTest extends Provider {
  16. protected function setUp(): void {
  17. $libreofficeBinary = \OC_Helper::findBinaryPath('libreoffice');
  18. $openofficeBinary = ($libreofficeBinary) ? null : \OC_Helper::findBinaryPath('openoffice');
  19. if ($libreofficeBinary || $openofficeBinary) {
  20. parent::setUp();
  21. $fileName = 'testimage.odt';
  22. $this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
  23. $this->width = 595;
  24. $this->height = 842;
  25. $this->provider = new \OC\Preview\OpenDocument;
  26. } else {
  27. $this->markTestSkipped('No Office provider present');
  28. }
  29. }
  30. }