summaryrefslogtreecommitdiffstats
path: root/tests/lib/Preview
Commit message (Collapse)AuthorAgeFilesLines
* Fix existing test and add a specific one for the new caseMorris Jobke2020-08-131-9/+72
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-121-5/+5
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* fix memory leak caused by not destroying image in Preview/Generate.phpElijah Martin-Merrill2020-07-271-3/+2
| | | | Signed-off-by: Elijah Martin-Merrill <elijah@nyp-itsours.com>
* Move to subfolders for preview filesRoeland Jago Douma2020-04-191-26/+70
| | | | | | | | | | | Else the number of files can grow very large very quickly in the preview folder. Esp on large systems. This generates the md5 of the fileid. And then creates folders of the first 7 charts. In that folder is then a folder with the fileid. And inside there are the previews. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add visibility to all properties and move static keywordChristoph Wurst2020-04-101-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20422 from ↵Christoph Wurst2020-04-109-18/+0
|\ | | | | | | | | nextcloud/techdebt/format-control-structs-classes-methods Format control structures, classes, methods and function
| * Format control structures, classes, methods and functionChristoph Wurst2020-04-109-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Merge pull request #19495 from nextcloud/preview-generate-batchRoeland Jago Douma2020-04-101-14/+23
|\ \ | |/ |/| optimize batch generation of previews
| * fix preview generation testsRobin Appelman2020-04-101-14/+23
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Use elseif instead of else ifChristoph Wurst2020-04-101-5/+5
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Remove trailing and in between spacesChristoph Wurst2020-04-091-1/+1
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-8/+8
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20170 from nextcloud/techdebt/remove-unused-importsChristoph Wurst2020-03-272-2/+0
|\ | | | | Remove unused imports
| * Remove unused importsChristoph Wurst2020-03-252-2/+0
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-8/+8
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Mode to modern phpunitRoeland Jago Douma2019-11-2710-11/+11
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-2711-14/+14
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-222-1/+2
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add new Provider interface for preview providersRobin Appelman2019-06-172-4/+8
| | | | | | | | | the main difference is passing the `File` object to the provider instead of a `View` + path Old providers will still continue to work as before Signed-off-by: Robin Appelman <robin@icewind.nl>
* use a fresh appdata factory in background job testRobin Appelman2018-12-061-1/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Only generate previews in powers of 4 and set minRoeland Jago Douma2018-10-311-8/+14
| | | | | | | | | | | | | | | Before we'd round up all preview request to their nearest power of two. This resulted still in a lot of possible images. Generating a lot of server load and taking up a lot of space. This moves it to previews to be powers of 4: 64, 256, 1024 and 4096 Also the first two powers are always skipped (4, 16) as it doesn't make sense to generate previews for that. We cache preview pretty agressively and I feel this is a better tradeoff. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #10526 from steiny2k/HEICHEIFMorris Jobke2018-08-221-0/+48
|\ | | | | Support HEIC for previews
| * Address comments from @rullzer:Sebastian Steinmetz2018-08-171-6/+12
| | | | | | | | | | | | | | - implement isAvailable - run tests only if ImageMagick with HEIC support is available in the environment Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
| * Testcase for HEIC image (similar to the ImageTest)Sebastian Steinmetz2018-08-111-0/+42
| | | | | | Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
* | Check if a preview provider is available before using itRoeland Jago Douma2018-08-171-2/+12
|/ | | | | | | | Else if a preview provider is registerd but not available (for example missing support in some external lib). It will do :boom:. This way the providers can at least do the sanity checks required. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make sure the file is readable before attempting to create a previewRoeland Jago Douma2018-05-301-0/+20
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add testsRoeland Jago Douma2018-05-141-0/+159
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't lie about the preview mimetypeRoeland Jago Douma2018-01-071-0/+8
| | | | | | | | | | | | | | For legacy reasons we stored all the previews with a png extention. However we did not put png data in them all the time. This caused the preview endpoints to always report that a preview is a png file. Which was a lie. Since we abstract away from the storage etc in the previewmanager. There is no need anymore to store them as .png files and instead we can use the actual file extention. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* fix preview testsRobin Appelman2017-05-021-0/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix testsRoeland Jago Douma2017-03-191-1/+5
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Dispatch event on preview requestRoeland Jago Douma2016-11-101-1/+67
| | | | | | Fixes: #73 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Added genertor helper & testsRoeland Jago Douma2016-11-031-0/+338
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move tests/ to PSR-4 (#24731)Joas Schilling2016-05-208-0/+512
* Move a-b to PSR-4 * Move c-d to PSR-4 * Move e+g to PSR-4 * Move h-l to PSR-4 * Move m-r to PSR-4 * Move s-u to PSR-4 * Move files/ to PSR-4 * Move remaining tests to PSR-4 * Remove Test\ from old autoloader