<?php

/**
 * Created by PhpStorm.
 * User: stanley-king
 * Date: 16/8/8
 * Time: 下午11:16
 */

define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));

require_once(BASE_ROOT_PATH . '/fooder.php');
require_once(BASE_DATA_PATH . '/api/audio/getid3.php');

class testSystem extends PHPUnit_Framework_TestCase
{
    public static function setUpBeforeClass()
    {
        Base::run_util();
    }

    public function testAreas()
    {
        $items = Model('area')->field('*')->order('area_id')->limit(false)->select();
        foreach($items as $item) {
            $val['aid'] = intval($item['area_id']);
            $val['n'] = $item['area_name'];
            $val['pid'] = intval($item['area_parent_id']);
            $val['d'] = intval($item['area_deep']);

            $areas[] = $val;
        }

        $txt = json_encode($areas,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
    }
    public function testMobile()
    {
        $x = intval('13911129867');

        if($x == '13911129867') {
            echo "==";
        }
    }
    public function testMobiles()
    {
        $mobiles = "13911129867,18911779278,13681651248,18262273057,13813416101,18961950030,15000321164";
        $kv = preg_split('/,/',$mobiles);
    }

    public function testUrl()
    {
        $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";
        $url = urldecode($x);
    }

    public function testAudio()
    {
        $getID3 = new getID3();
        $info = $getID3->analyze("/Users/stanley-king/Downloads/20170615_1548_389132.mp3");
    }
}
