More phpunit tests

This commit is contained in:
Laurent Destailleur 2012-08-05 13:07:17 +02:00
parent 64e32258c2
commit 386a1dcb55

View File

@ -388,6 +388,31 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
}
/**
* testImgPicto
*
* @return void
*/
public function testImgPicto()
{
$s=img_picto('alt','user');
print __METHOD__." s=".$s."\n";
$this->assertContains('theme',$s,'testImgPicto1');
$s=img_picto('alt','img.png','style="float: right"',0);
print __METHOD__." s=".$s."\n";
$this->assertContains('theme',$s,'testImgPicto2');
$this->assertContains('style="float: right"',$s,'testImgPicto2');
$s=img_picto('alt','/fullpath/img.png','',1);
print __METHOD__." s=".$s."\n";
$this->assertEquals($s,'<img src="/fullpath/img.png" border="0" alt="alt" title="alt">','testImgPicto3');
$s=img_picto('alt','/fullpath/img.png','',true);
print __METHOD__." s=".$s."\n";
$this->assertEquals($s,'<img src="/fullpath/img.png" border="0" alt="alt" title="alt">','testImgPicto3');
}
/**
* testDolNow
*
@ -397,7 +422,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{
$now=dol_now('gmt');
$nowtzserver=dol_now('tzserver');
print __METHOD__."getServerTimeZoneInt=".(getServerTimeZoneInt('now')*3600)."\n";
print __METHOD__." getServerTimeZoneInt=".(getServerTimeZoneInt('now')*3600)."\n";
$this->assertEquals(getServerTimeZoneInt('now')*3600,($nowtzserver-$now));
}