systemTest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. class systemTest extends PHPUnit_Framework_TestCase
  11. {
  12. public static function setUpBeforeClass()
  13. {
  14. Base::run_util();
  15. }
  16. public function testAreas()
  17. {
  18. $items = Model('area')->field('*')->order('area_id')->limit(false)->select();
  19. foreach($items as $item) {
  20. $val['aid'] = intval($item['area_id']);
  21. $val['n'] = $item['area_name'];
  22. $val['pid'] = intval($item['area_parent_id']);
  23. $val['d'] = intval($item['area_deep']);
  24. $areas[] = $val;
  25. }
  26. $txt = json_encode($areas,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
  27. }
  28. public function testMobile()
  29. {
  30. $x = intval('13911129867');
  31. if($x == '13911129867') {
  32. echo "==";
  33. }
  34. }
  35. public function testMobiles()
  36. {
  37. $mobiles = "13911129867,18911779278,13681651248,18262273057,13813416101,18961950030,15000321164";
  38. $kv = preg_split('/,/',$mobiles);
  39. }
  40. public function testUrl()
  41. {
  42. $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";
  43. $url = urldecode($x);
  44. }
  45. }