mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-10 09:52:33 +01:00
code syntax
This commit is contained in:
@@ -30,8 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/images.lib.php';
|
||||
|
||||
if (empty($user->id))
|
||||
{
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
$user->fetch(1);
|
||||
$user->getrights();
|
||||
@@ -76,81 +75,81 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* setUpBeforeClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
* setUpBeforeClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDownAfterClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
/**
|
||||
* tearDownAfterClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->rollback();
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
protected function setUp()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
protected function tearDown()
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* testDolCountNbOfLine
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function testgetImageSize()
|
||||
{
|
||||
/**
|
||||
* testDolCountNbOfLine
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function testgetImageSize()
|
||||
{
|
||||
$file=dirname(__FILE__).'/img250x50.jpg';
|
||||
$tmp=dol_getImageSize($file);
|
||||
print __METHOD__." result=".$tmp['width'].'/'.$tmp['height']."\n";
|
||||
print __METHOD__." result=".$tmp['width'].'/'.$tmp['height']."\n";
|
||||
$this->assertEquals($tmp['width'], 250);
|
||||
$this->assertEquals($tmp['height'], 50);
|
||||
|
||||
$file=dirname(__FILE__).'/img250x20.png';
|
||||
$tmp=dol_getImageSize($file);
|
||||
print __METHOD__." result=".$tmp['width'].'/'.$tmp['height']."\n";
|
||||
print __METHOD__." result=".$tmp['width'].'/'.$tmp['height']."\n";
|
||||
$this->assertEquals($tmp['width'], 250);
|
||||
$this->assertEquals($tmp['height'], 20);
|
||||
|
||||
/*$file=dirname(__FILE__).'/filenotfound.png';
|
||||
$tmp=dol_getImageSize($file);
|
||||
print __METHOD__." result=".$tmp['width'].'/'.$tmp['height']."\n";
|
||||
print __METHOD__." result=".$tmp['width'].'/'.$tmp['height']."\n";
|
||||
$this->assertEquals($tmp['width'],250);
|
||||
$this->assertEquals($tmp['height'],20);*/
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user