1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2017/4/11
- * Time: 下午5:52
- */
- define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/memsg/message_sender.php');
- require_once(BASE_ROOT_PATH . '/helper/push_sender.php');
- class TestPush extends PHPUnit_Framework_TestCase
- {
- const test_android_member_id = 39625;//40287; //android
- const test_ios_member_id = 39623;//52169;
- //const test_member_id = 36490;
- public static function setUpBeforeClass()
- {
- Base::run_util();
- }
- public function testPusher()
- {
- $sender = new memsg\message_sender();
- $sender->send();
- }
- public function testTenPaysuccess()
- {
- for ($i = 0; $i < 10; ++$i)
- {
- push_helper::paysuccess_bonus(self::test_android_member_id,100);
- push_helper::paysuccess_bonus(self::test_ios_member_id,100);
- }
- }
- public function testPaysuccess()
- {
- account_helper::onAsyncOrderPaied('270563196360813623');
- }
- public function testOrderComplete()
- {
- account_helper::onAsyncOrderComplete('270563196360813623');
- }
- public function testMessage()
- {
- $pushor = new push_sender();
- $info['member_id'] = self::test_member_id;
- $info['text'] = 'hello message';
- $info['custom'] = ['type' => 'add_special','special_id' => 300];
- $pushor->send_message($info);
- }
- public function testDialog()
- {
- push_helper::first_present(self::test_android_member_id,'http://192.168.0.200/mobile/index.php?act=webpush&op=fcode&client_type=ios');
- push_helper::first_present(self::test_ios_member_id,'http://192.168.0.200/mobile/index.php?act=webpush&op=fcode&client_type=ios');
- }
- }
|