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 11:54:43 +0300
committerGitHub <noreply@github.com>2016-09-07 11:54:43 +0300
commit4aba0797696031fd6191340b7db95ad495d11649 (patch)
treedc73f297de5125ceb4f3bcc8d2d44e57307de586
parente7b469b730c0a0908d6313b529609d36fb1a835d (diff)
parent5b351009be958c140ce71937327df7f540ab7c48 (diff)
Merge pull request #26051 from owncloud/stable9-fix-preview-tests
[stable9] Fix failing preview unit tests (#26039)
-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 4fca56dd984..471ced4aadb 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -130,7 +130,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 bc6f849cbe8..5c1d55170a2 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;
@@ -41,7 +42,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
@@ -77,10 +78,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');
@@ -310,8 +311,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;
@@ -562,7 +561,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(
@@ -779,14 +778,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'];