控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RotateTest.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 RotateTest extends TestCase
  14. {
  15. public function testJpeg()
  16. {
  17. $pathname = TEST_PATH . 'tmp/rotate.jpg';
  18. $image = Image::open($this->getJpeg());
  19. $image->rotate(90)->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/rotate.gif';
  27. $image = Image::open($this->getGif());
  28. $image->rotate(90)->save($pathname);
  29. $file = new \SplFileInfo($pathname);
  30. $this->assertTrue($file->isFile());
  31. @unlink($pathname);
  32. }
  33. }