FFIModeTest.php 623 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Yurun\Util\ChineseUtil\Test;
  3. /**
  4. * @testdox FFI Mode
  5. */
  6. class FFIModeTest extends BaseTest
  7. {
  8. /**
  9. * 模式.
  10. *
  11. * @var string
  12. */
  13. protected $mode = 'FFI';
  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. }
  29. }