ExiftoolServerTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * This file is part of the PHPExiftool package.
  4. *
  5. * (c) Alchemy <support@alchemy.fr>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace PHPExiftool\Test;
  11. use PHPExiftool\ExiftoolServer;
  12. class ExiftoolServerTest extends \PHPUnit_Framework_TestCase
  13. {
  14. protected $exiftool;
  15. public function setUp()
  16. {
  17. $this->exiftool = new ExiftoolServer();
  18. $this->exiftool->start();
  19. }
  20. public function tearDown()
  21. {
  22. $this->exiftool->stop();
  23. }
  24. /**
  25. * @covers PHPExiftool\ExiftoolServer::executeCommand
  26. */
  27. public function testExecuteCommand()
  28. {
  29. $this->assertRegExp('/\d+\.\d+/', $this->exiftool->executeCommand('-ver'));
  30. }
  31. /**
  32. * @covers PHPExiftool\ExiftoolServer::executeCommand
  33. * @covers \PHPExiftool\Exception\RuntimeException
  34. * @expectedException \PHPExiftool\Exception\RuntimeException
  35. */
  36. public function testExecuteCommandFailed()
  37. {
  38. $this->markTestSkipped('Currently disable server support');
  39. $this->exiftool->executeCommand('-prout');
  40. }
  41. public function testReset()
  42. {
  43. $this->exiftool->reset();
  44. $this->exiftool->start();
  45. $this->assertTrue($this->exiftool->isRunning());
  46. }
  47. public function testStop()
  48. {
  49. $this->exiftool->stop();
  50. $this->assertFalse($this->exiftool->isRunning());
  51. }
  52. }