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

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests/api
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-09-08 23:47:13 +0300
committerOlivier Paroz <github@oparoz.com>2015-09-08 23:47:13 +0300
commite3686034ab7eeec493022df3ee021eacc6dc48a9 (patch)
treed958d770661be7f3cfaa32d16a0d74f03fde9de5 /tests/api
parentdab919f36ef447a2c50eb0f6aef13e9c9da80d47 (diff)
Use 2 different type of files to test the API previews
Diffstat (limited to 'tests/api')
-rw-r--r--tests/api/GetPreviewCest.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/tests/api/GetPreviewCest.php b/tests/api/GetPreviewCest.php
index cd0d889f..ab2facc5 100644
--- a/tests/api/GetPreviewCest.php
+++ b/tests/api/GetPreviewCest.php
@@ -40,16 +40,38 @@ class GetPreviewCest {
$I->connectToTheApi($this->apiUrl . '/9999999/1920/1080', 'the preview API');
}
- public function getPreview(\Step\Api\User $I) {
+ public function getPreviewOfPng(\Step\Api\User $I) {
$I->am('an app');
- $I->wantTo('get the preview of a file');
+ $I->wantTo('get the preview of a PNG file');
+
+ $I->getUserCredentialsAndUseHttpAuthentication();
+ $data = $I->getFilesDataForFolder('folder2');
+ $file = $data['testimage.png'];
+ $url = $this->apiUrl . '/' . $file['id'] . '/64/64';
+ $I->sendGET($url);
+ $I->downloadAFile($file, 'testimage.png');
+ $I->checkImageSize(64, 64);
+ }
+
+ /**
+ * That's a different code path because the file is animated
+ *
+ * @todo maybe
+ *
+ * @param \Step\Api\User $I
+ */
+ public function getPreviewOfAnimatedGif(\Step\Api\User $I) {
+ $I->am('an app');
+ $I->wantTo('get the preview of an animated GIF file');
$I->getUserCredentialsAndUseHttpAuthentication();
$data = $I->getFilesDataForFolder('');
+ // 89x72 gif
$file = $data['animated.gif'];
- $url = $this->apiUrl . '/' . $file['id'] . '/1920/1080';
+ $url = $this->apiUrl . '/' . $file['id'] . '/64/64';
$I->sendGET($url);
$I->downloadAFile($file, 'animated.gif');
+ $I->checkImageSize(89, 72);
}
public function emptyResponse(\Step\Api\User $I) {