ImageTest.php 776 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @package Kohana/Image
  4. * @group kohana
  5. * @group kohana.image
  6. * @category Test
  7. * @author Kohana Team
  8. * @copyright (c) Kohana Team
  9. * @license https://koseven.ga/LICENSE.md
  10. */
  11. class Kohana_ImageTest extends Unittest_TestCase {
  12. public function setUp(): void
  13. {
  14. parent::setUp();
  15. if ( ! extension_loaded('gd'))
  16. {
  17. $this->markTestSkipped('The GD extension is not available.');
  18. }
  19. }
  20. /**
  21. * Tests the Image::save() method for files that don't have extensions
  22. *
  23. * @return void
  24. */
  25. public function test_save_without_extension()
  26. {
  27. $image = Image::factory(MODPATH.'image/tests/test_data/test_image');
  28. $this->assertTrue($image->save(Kohana::$cache_dir.'/test_image'));
  29. unlink(Kohana::$cache_dir.'/test_image');
  30. }
  31. }