123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/24
- * Time: 上午1:20
- */
- define('APP_ID', 'test');
- define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/global.php');
- require_once(BASE_CORE_PATH . '/lrlz.php');
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/algorithm.php');
- use PHPUnit\Framework\TestCase;
- class TestAlgorithm extends TestCase
- {
- public function testSearch()
- {
- $mobiles = array('13911129897','13951129867','13916129867','13918129867','13911179867','13911109867');
- sort($mobiles);
- $ret = algorithm::bsearch('13911109867',$mobiles);
-
- $ret = $mobiles[$ret];
- $x = $mobiles[0];
- }
- public function testEncrypt()
- {
- $x = encrypt('123456','55668899');
- $y = decrypt($x,'55668899');
- }
- }
|