image.lib.test.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. require_once(api_get_path(LIBRARY_PATH).'image.lib.php');
  3. class TestImage extends UnitTestCase {
  4. public $timage;
  5. public function TestImage(){
  6. $this->UnitTestCase('All main image function tests');
  7. }
  8. public function setUp(){
  9. $this->timage = new image();
  10. }
  11. public function tearDown(){
  12. $this->timage = null;
  13. }
  14. public function testAddBackGround() {
  15. $bgfile='';
  16. $res=$this->timage->addbackground($bgfile);
  17. $this->assertTrue(is_null($res));
  18. //var_dump($bgfile);
  19. }
  20. public function testAddLogo() {
  21. $file='';
  22. $res=$this->timage->addlogo($file);
  23. $this->assertTrue(is_null($res));
  24. //var_dump($res);
  25. }
  26. public function testaddtext() {
  27. $text='';
  28. $res=$this->timage->addtext($text);
  29. $this->assertTrue(is_null($res));
  30. //var_dump($res);
  31. }
  32. public function testcreateimagefromtype() {
  33. $file='';
  34. $handler='';
  35. $res=$this->timage->createimagefromtype($file,$handler);
  36. $this->assertTrue(is_null($res));
  37. //var_dump($res);
  38. }
  39. public function testimagenaddback() {
  40. $bgfile='';
  41. $res=$this->timage->image($bgfile);
  42. $this->assertTrue(is_null($res));
  43. //var_dump($res);
  44. }
  45. public function testmakecolor() {
  46. $red='';
  47. $green='';
  48. $blue='';
  49. $res=$this->timage->makecolor($red, $green, $blue);
  50. $this->assertTrue(is_null($res));
  51. //var_dump($res);
  52. }
  53. public function testmergelogo() {
  54. $x='';
  55. $y='';
  56. $res=$this->timage->mergelogo($x,$y);
  57. $this->assertTrue(is_bool($res));
  58. //var_dump($res);
  59. }
  60. public function testresize() {
  61. $thumbw='';
  62. $thumbh='';
  63. $border='';
  64. $res=$this->timage->resize($thumbw , $thumbh , $border);
  65. $this->assertTrue(is_null($res));
  66. //var_dump($res);
  67. }
  68. public function testsend_image() {
  69. $type='';
  70. $res=$this->timage->send_image($type);
  71. $this->assertTrue(is_numeric($res));
  72. //var_dump($res);
  73. }
  74. public function testsetfont() {
  75. $fontfile=$this->fontfile;
  76. $res=$this->timage->setfont($fontfile);
  77. $this->assertTrue(is_null($res));
  78. //var_dump($res);
  79. }
  80. }
  81. ?>