TestSystem.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/8/8
  6. * Time: 下午11:16
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once(BASE_ROOT_PATH . '/fooder.php');
  10. require_once(BASE_DATA_PATH . '/api/audio/getid3.php');
  11. class testSystem extends PHPUnit_Framework_TestCase
  12. {
  13. public static function setUpBeforeClass()
  14. {
  15. Base::run_util();
  16. }
  17. public function testAreas()
  18. {
  19. $items = Model('area')->field('*')->order('area_id')->limit(false)->select();
  20. foreach($items as $item) {
  21. $val['aid'] = intval($item['area_id']);
  22. $val['n'] = $item['area_name'];
  23. $val['pid'] = intval($item['area_parent_id']);
  24. $val['d'] = intval($item['area_deep']);
  25. $areas[] = $val;
  26. }
  27. $txt = json_encode($areas,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
  28. }
  29. public function testMobile()
  30. {
  31. $x = intval('13911129867');
  32. if($x == '13911129867') {
  33. echo "==";
  34. }
  35. }
  36. public function testMobiles()
  37. {
  38. $mobiles = "13911129867,18911779278,13681651248,18262273057,13813416101,18961950030,15000321164";
  39. $kv = preg_split('/,/',$mobiles);
  40. }
  41. public function testUrl()
  42. {
  43. $x = "http://p.lrlz.com/mobile/index.html?v=2017061402#/special?special_id=442&is_special=true&title=%E5%91%98%E5%B7%A5%E4%B8%93%E4%BA%AB%E5%A4%A7%E7%89%8C%E2%80%94%E2%80%94%E5%85%B0%E8%94%BB%EF%BC%8C%E7%A2%A7%E6%AC%A7%E6%B3%89%EF%BC%8C%E6%A4%8D%E6%9D%91%E7%A7%80";
  44. $url = urldecode($x);
  45. }
  46. public function testAudio()
  47. {
  48. $getID3 = new getID3();
  49. $info = $getID3->analyze("/Users/stanley-king/Downloads/20170615_1548_389132.mp3");
  50. }
  51. }