12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/24
- * Time: 上午1:20
- */
- define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/algorithm.php');
- class TestAlgorithm extends PHPUnit_Framework_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');
- }
- }
|