aboutsummaryrefslogblamecommitdiffstats
path: root/tests/unit/includes/PhotodriverTest.php
blob: 34dc058b78060ccb567314c9403dc993ef2b5733 (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                                      
                                    




                                                                  

                                                                         

                                                         


                                                                                     
                                                                           
 

                                                                                            
         
 
<?php

namespace Zotlabs\Tests\Unit\includes;

use Zotlabs\Tests\Unit\UnitTestCase;

/**
 * @brief Unit Test cases for include/photo/photo_driver.php file.
 */
class PhotodriverTest extends UnitTestCase {

	public function testPhotofactoryReturnsNullForUnsupportedType() {
		$photo = \photo_factory('', 'image/bmp');
		$this->assertNull($photo);
	}

	public function testPhotofactoryReturnsPhotogdIfConfigIgnore_imagickIsSet() {
		\Zotlabs\Lib\Config::Set('system', 'ignore_imagick', true);

		$photo = \photo_factory(file_get_contents('images/hz-16.png'), 'image/png');
		$this->assertInstanceOf('Zotlabs\Photo\PhotoGd', $photo);
	}
}