FlipTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: yunwuxin <448901948@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace tests;
  12. use think\Image;
  13. class FlipTest extends TestCase
  14. {
  15. public function testJpeg()
  16. {
  17. $pathname = TEST_PATH . 'tmp/flip.jpg';
  18. $image = Image::open($this->getJpeg());
  19. $image->flip()->save($pathname);
  20. $file = new \SplFileInfo($pathname);
  21. $this->assertTrue($file->isFile());
  22. @unlink($pathname);
  23. }
  24. public function testGif()
  25. {
  26. $pathname = TEST_PATH . 'tmp/flip.gif';
  27. $image = Image::open($this->getGif());
  28. $image->flip(Image::FLIP_Y)->save($pathname);
  29. $file = new \SplFileInfo($pathname);
  30. $this->assertTrue($file->isFile());
  31. @unlink($pathname);
  32. }
  33. }