aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/includes/PhotodriverTest.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-01-06 16:34:39 +0000
committerMario <mario@mariovavti.com>2024-01-06 16:34:39 +0000
commita36de8ba1a27204667413760c53f783ba60f22a7 (patch)
treefa219c32ebe5d8cad86dccc6b26b04ed6c22145b /tests/unit/includes/PhotodriverTest.php
parentc73518d8ec562aed63223c668a43d9cda152cb9d (diff)
parente3d30763dabdf12f961ed3d1d7cf4eaee44c65a9 (diff)
downloadvolse-hubzilla-a36de8ba1a27204667413760c53f783ba60f22a7.tar.gz
volse-hubzilla-a36de8ba1a27204667413760c53f783ba60f22a7.tar.bz2
volse-hubzilla-a36de8ba1a27204667413760c53f783ba60f22a7.zip
Merge branch 'tests/fix-db-and-ci-integration' into 'dev'
tests: Integrate the DB in "unit" tests. See merge request hubzilla/core!2081
Diffstat (limited to 'tests/unit/includes/PhotodriverTest.php')
-rw-r--r--tests/unit/includes/PhotodriverTest.php28
1 files changed, 6 insertions, 22 deletions
diff --git a/tests/unit/includes/PhotodriverTest.php b/tests/unit/includes/PhotodriverTest.php
index 6f6ad0ffe..34dc058b7 100644
--- a/tests/unit/includes/PhotodriverTest.php
+++ b/tests/unit/includes/PhotodriverTest.php
@@ -2,38 +2,22 @@
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.');
+ $photo = \photo_factory('', 'image/bmp');
+ $this->assertNull($photo);
}
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);
+ \Zotlabs\Lib\Config::Set('system', 'ignore_imagick', true);
- $this->markTestIncomplete('Need to mock get_config(), otherwise not unit testable.');
+ $photo = \photo_factory(file_get_contents('images/hz-16.png'), 'image/png');
+ $this->assertInstanceOf('Zotlabs\Photo\PhotoGd', $photo);
}
-} \ No newline at end of file
+}