queueTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/7/20
  6. * Time: 下午4:16
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once(BASE_ROOT_PATH . '/fooder.php');
  10. class queueTest extends PHPUnit_Framework_TestCase
  11. {
  12. public static function setUpBeforeClass()
  13. {
  14. Base::run_util();
  15. }
  16. public function testPush()
  17. {
  18. //{"action":"sendreq","params":null}
  19. $x['action'] = 'sendreq';
  20. $x['params'] = array('speed' => 30);
  21. $y = json_encode($x);
  22. $param['member_id'] = 36490;
  23. $param['text'] = "红包退还通知:您发送的红包已超过24小时,退还未被领取的金额1234元,请在收支明细中查看.";
  24. $param['go_type'] = '';
  25. QueueClient::push('upushSendMsg',$param);
  26. }
  27. public function testOrderSuccess()
  28. {
  29. $mod = Model('order');
  30. $pay_sn = '270563196360813623';
  31. $order_info = $mod->getOrderInfo(array('pay_sn' => $pay_sn));
  32. $logic_order = Logic('order');
  33. $result = $logic_order->changeOrderStateReceive($order_info,'system','系统','超期未收货系统自动完成订单');
  34. }
  35. public function testEvaluate()
  36. {
  37. account_helper::onEvaluate(36490);
  38. }
  39. public static function tearDownAfterClass()
  40. {
  41. }
  42. }