From 386a1dcb55369b802d22d255c26dc72bc3688526 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sun, 5 Aug 2012 13:07:17 +0200 Subject: [PATCH] More phpunit tests --- test/phpunit/FunctionsTest.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/test/phpunit/FunctionsTest.php b/test/phpunit/FunctionsTest.php index 7a65f198951..67aee8988a7 100755 --- a/test/phpunit/FunctionsTest.php +++ b/test/phpunit/FunctionsTest.php @@ -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)); } -- GitLab