aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/includes/PhotodriverTest.php
diff options
context:
space:
mode:
authorManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-02-19 12:15:59 +0100
committerManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-02-19 12:15:59 +0100
commitc5bb0745737432c6d27e9468e56ad0bd33698462 (patch)
tree7d6b7a364941b9325ea319e6564e9f6123f059f2 /tests/unit/includes/PhotodriverTest.php
parent4e8fc6d19851b6d05a49d5151aaa1f0f1fcfb5c0 (diff)
parentcead10b9af6ff9d8b1bc702ca21d27af7c2112f0 (diff)
downloadvolse-hubzilla-c5bb0745737432c6d27e9468e56ad0bd33698462.tar.gz
volse-hubzilla-c5bb0745737432c6d27e9468e56ad0bd33698462.tar.bz2
volse-hubzilla-c5bb0745737432c6d27e9468e56ad0bd33698462.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'tests/unit/includes/PhotodriverTest.php')
-rw-r--r--tests/unit/includes/PhotodriverTest.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/unit/includes/PhotodriverTest.php b/tests/unit/includes/PhotodriverTest.php
new file mode 100644
index 000000000..6f6ad0ffe
--- /dev/null
+++ b/tests/unit/includes/PhotodriverTest.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace Zotlabs\Tests\Unit\includes;
+
+//use Zotlabs\Photo\PhotoGd;
+use Zotlabs\Tests\Unit\UnitTestCase;
+//use phpmock\phpunit\PHPMock;
+
+/**
+ * @brief Unit Test cases for include/photo/photo_driver.php file.
+ */
+class PhotodriverTest extends UnitTestCase {
+ //use PHPMock;
+
+ public function testPhotofactoryReturnsNullForUnsupportedType() {
+ // php-mock can not mock global functions which is called by a global function.
+ // If the calling function is in a namespace it would work.
+ //$logger = $this->getFunctionMock(__NAMESPACE__, 'logger');
+ //$logger->expects($this->once());
+
+ //$ph = \photo_factory('', 'image/bmp');
+ //$this->assertNull($ph);
+
+ $this->markTestIncomplete('Need to mock logger(), otherwise not unit testable.');
+ }
+
+ public function testPhotofactoryReturnsPhotogdIfConfigIgnore_imagickIsSet() {
+ // php-mock can not mock global functions which is called by a global function.
+ // If the calling function is in a namespace it would work.
+ //$gc = $this->getFunctionMock(__NAMESPACE__, 'get_config');
+ // simulate get_config('system', 'ignore_imagick') configured
+ //$gc->expects($this->once())->willReturn(1)
+
+ //$ph = \photo_factory(file_get_contents('images/hz-16.png'), 'image/png');
+ //$this->assertInstanceOf(PhotoGd::class, $ph);
+
+ $this->markTestIncomplete('Need to mock get_config(), otherwise not unit testable.');
+ }
+} \ No newline at end of file