@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+24
+24
src/applications/files/transform/__tests__/PhabricatorFileTransformTestCase.php
··· 2 2 3 3 final class PhabricatorFileTransformTestCase extends PhabricatorTestCase { 4 4 5 + protected function getPhabricatorTestCaseConfiguration() { 6 + return array( 7 + self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true, 8 + ); 9 + } 10 + 5 11 public function testGetAllTransforms() { 6 12 PhabricatorFileTransform::getAllTransforms(); 7 13 $this->assertTrue(true); 14 + } 15 + 16 + public function testThumbTransformDefaults() { 17 + $xforms = PhabricatorFileTransform::getAllTransforms(); 18 + $file = new PhabricatorFile(); 19 + 20 + foreach ($xforms as $xform) { 21 + if (!($xform instanceof PhabricatorFileThumbnailTransform)) { 22 + continue; 23 + } 24 + 25 + // For thumbnails, generate the default thumbnail. This should be able 26 + // to generate something rather than throwing an exception because we 27 + // forgot to add a default file to the builtin resources. See T12614. 28 + $xform->getDefaultTransform($file); 29 + 30 + $this->assertTrue(true); 31 + } 8 32 } 9 33 10 34 }