IntStrTest.php 548 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace EasySwoole\Utility\Tests;
  3. use EasySwoole\Utility\IntStr;
  4. use PHPUnit\Framework\Assert;
  5. use PHPUnit\Framework\TestCase;
  6. /**
  7. * Class IntStrTest
  8. * @package EasySwoole\Utility\Tests
  9. */
  10. class IntStrTest extends TestCase
  11. {
  12. public function test(){
  13. for ($i=0;$i<=10000;$i++){
  14. $str = IntStr::toAlpha($i);
  15. $this->assertEquals($i,IntStr::toNum($str));
  16. }
  17. $int = 489404994190181376;
  18. $str = IntStr::toAlpha($int);
  19. $this->assertEquals($int,IntStr::toNum($str));
  20. }
  21. }