SwooleFFIModeTest.php 776 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Yurun\Util\ChineseUtil\Test;
  3. /**
  4. * @testdox Swoole FFI Mode
  5. */
  6. class SwooleFFIModeTest extends BaseTest
  7. {
  8. /**
  9. * 模式.
  10. *
  11. * @var string
  12. */
  13. protected $mode = 'SwooleFFI';
  14. protected function check()
  15. {
  16. if ('0' === getenv('CHINESE_UTIL_FFI'))
  17. {
  18. $this->markTestSkipped('Not test FFI');
  19. }
  20. if (version_compare(\PHP_VERSION, '7.4', '<'))
  21. {
  22. $this->markTestSkipped('PHP need >= 7.4');
  23. }
  24. if (!\extension_loaded('FFI'))
  25. {
  26. $this->markTestSkipped('You must enable FFI extension');
  27. }
  28. if (!\extension_loaded('Swoole'))
  29. {
  30. $this->markTestSkipped('You must enable Swoole extension');
  31. }
  32. }
  33. }