algorithm_helperTest.php 596 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/6/24
  6. * Time: 上午1:20
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once(BASE_ROOT_PATH . '/helper/algorithm.php');
  10. class algorithm_helperTest extends PHPUnit_Framework_TestCase
  11. {
  12. public function testSearch()
  13. {
  14. $mobiles = array('13911129897','13951129867','13916129867','13918129867','13911179867','13911109867');
  15. sort($mobiles);
  16. $ret = algorithm::bsearch('13911109867',$mobiles);
  17. $ret = $mobiles[$ret];
  18. $x = $mobiles[0];
  19. }
  20. }