TestCase.php 543 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. declare(strict_types=1);
  3. namespace Ramsey\Uuid\Test;
  4. use Mockery;
  5. use PHPUnit\Framework\TestCase as PhpUnitTestCase;
  6. use function current;
  7. use function pack;
  8. use function unpack;
  9. class TestCase extends PhpUnitTestCase
  10. {
  11. protected function tearDown(): void
  12. {
  13. parent::tearDown();
  14. Mockery::close();
  15. }
  16. public static function isLittleEndianSystem(): bool
  17. {
  18. /** @var array $unpacked */
  19. $unpacked = unpack('v', pack('S', 0x00FF));
  20. return current($unpacked) === 0x00FF;
  21. }
  22. }