Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-09-07 10:45:37 +0300
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-09-07 10:45:37 +0300
commit1fd2280fc7925626059919170f7bd3b8c106c36f (patch)
tree3b53a5a14983230a3dcadebd4833ec37a8ae6e47
parent0114b9e804124016e880e5799a6c90e937e0f9e1 (diff)
[stable8.2] Fix failing preview unit tests (#26039) (#26053)
* Fix failing preview unit tests (#26039) * Fix preview namespaces from backport
-rw-r--r--lib/private/preview.php2
-rw-r--r--tests/lib/preview.php20
2 files changed, 7 insertions, 15 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index b2accdfd00f..fbe07de70e5 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -129,7 +129,7 @@ class Preview {
$this->setFile($file);
$this->setMaxX((int)$maxX);
$this->setMaxY((int)$maxY);
- $this->setScalingUp($scalingUp);
+ $this->setScalingup($scalingUp);
$this->preview = null;
diff --git a/tests/lib/preview.php b/tests/lib/preview.php
index e4c599c66cf..6fa447ce9ca 100644
--- a/tests/lib/preview.php
+++ b/tests/lib/preview.php
@@ -23,6 +23,7 @@
namespace Test;
use OC\Files\FileInfo;
+use OC\Files\Filesystem;
use OC\Files\Storage\Temporary;
use OC\Files\View;
use Test\Traits\MountProviderTrait;
@@ -34,7 +35,7 @@ class Preview extends TestCase {
const TEST_PREVIEW_USER1 = "test-preview-user1";
- /** @var \OC\Files\View */
+ /** @var View */
private $rootView;
/**
* Note that using 756 with an image with a ratio of 1.6 brings interesting rounding issues
@@ -70,10 +71,10 @@ class Preview extends TestCase {
$this->createUser(self::TEST_PREVIEW_USER1, self::TEST_PREVIEW_USER1);
$this->loginAsUser(self::TEST_PREVIEW_USER1);
- $storage = new \OC\Files\Storage\Temporary([]);
- \OC\Files\Filesystem::mount($storage, [], '/' . self::TEST_PREVIEW_USER1 . '/');
+ $storage = new Temporary([]);
+ Filesystem::mount($storage, [], '/' . self::TEST_PREVIEW_USER1 . '/');
- $this->rootView = new \OC\Files\View('');
+ $this->rootView = new View('');
$this->rootView->mkdir('/' . self::TEST_PREVIEW_USER1);
$this->rootView->mkdir('/' . self::TEST_PREVIEW_USER1 . '/files');
@@ -303,8 +304,6 @@ class Preview extends TestCase {
public function testCreateMaxAndNormalPreviewsAtFirstRequest(
$sampleId, $widthAdjustment, $heightAdjustment, $keepAspect = false, $scalingUp = false
) {
- //$this->markTestSkipped('Not testing this at this time');
-
// Get the right sample for the experiment
$this->getSample($sampleId);
$sampleWidth = $this->sampleWidth;
@@ -555,7 +554,7 @@ class Preview extends TestCase {
* @param int $width
* @param int $height
*
- * @return \OC\Preview
+ * @return Preview
*/
private function createPreview($width, $height) {
$preview = new \OC\Preview(
@@ -772,14 +771,7 @@ class Preview extends TestCase {
* @param $sampleId
*/
private function getSample($sampleId) {
- // Corrects a rounding difference when using the EPS (Imagick converted) sample
- $filename = $this->samples[$sampleId]['sampleFileName'];
- $splitFileName = pathinfo($filename);
- $extension = $splitFileName['extension'];
- $correction = ($extension === 'eps') ? 1 : 0;
$maxPreviewHeight = $this->samples[$sampleId]['maxPreviewHeight'];
- $maxPreviewHeight = $maxPreviewHeight - $correction;
-
$this->sampleFileId = $this->samples[$sampleId]['sampleFileId'];
$this->sampleFilename = $this->samples[$sampleId]['sampleFileName'];
$this->sampleWidth = $this->samples[$sampleId]['sampleWidth'];