mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-18 09:48:39 +01:00
Add unit tests for file thumbnail generation
Summary: Fixes T12614. Test Plan: - Ran tests, saw them pass. - Changed a thumbnail to 800x800, saw tests detect that the default image was missing. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12614 Differential Revision: https://secure.phabricator.com/D17773
This commit is contained in:
parent
52c4715bbc
commit
bb2b91d28e
1 changed files with 24 additions and 0 deletions
|
@ -2,9 +2,33 @@
|
||||||
|
|
||||||
final class PhabricatorFileTransformTestCase extends PhabricatorTestCase {
|
final class PhabricatorFileTransformTestCase extends PhabricatorTestCase {
|
||||||
|
|
||||||
|
protected function getPhabricatorTestCaseConfiguration() {
|
||||||
|
return array(
|
||||||
|
self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function testGetAllTransforms() {
|
public function testGetAllTransforms() {
|
||||||
PhabricatorFileTransform::getAllTransforms();
|
PhabricatorFileTransform::getAllTransforms();
|
||||||
$this->assertTrue(true);
|
$this->assertTrue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testThumbTransformDefaults() {
|
||||||
|
$xforms = PhabricatorFileTransform::getAllTransforms();
|
||||||
|
$file = new PhabricatorFile();
|
||||||
|
|
||||||
|
foreach ($xforms as $xform) {
|
||||||
|
if (!($xform instanceof PhabricatorFileThumbnailTransform)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For thumbnails, generate the default thumbnail. This should be able
|
||||||
|
// to generate something rather than throwing an exception because we
|
||||||
|
// forgot to add a default file to the builtin resources. See T12614.
|
||||||
|
$xform->getDefaultTransform($file);
|
||||||
|
|
||||||
|
$this->assertTrue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue