123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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
- {
- public static function setUpBeforeClass()
- {
- Base::run_util();
- }
- public function testPusher()
- {
- $sender = new memsg\message_sender();
- $sender->send();
- }
- public function testSubstring()
- {
- $str = "123456789ABCDEFG";
- $len = strlen($str);
- $start = 1;
- $x = substr($str,$start,$len - $start);
- $src = "BBB中国人AAA";
- $x = strlen($src);
- $y = substr($src,7,3);
- }
- public function testOption()
- {
- $ch = 65;
- $x = sprintf("%c",$ch);
- }
- public function testMessage()
- {
- $pushor = new push_sender();
- $info['member_id'] = 39187;
- $info['text'] = 'hello message';
- $info['custom'] = ['type' => 'add_special','special_id' => 300];
- $pushor->send_message($info);
- }
- }
|