12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php declare(strict_types=1);
- use PHPUnit\Framework\TestCase;
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 16/6/27
- * Time: 下午10:27
- */
- define('APP_ID', 'test');
- define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/global.php');
- require_once(BASE_CORE_PATH . '/lrlz.php');
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/bonus_helper.php');
- require_once(BASE_ROOT_PATH . '/helper/account_helper.php');
- require_once(BASE_ROOT_PATH . '/helper/category_helper.php');
- require_once(BASE_ROOT_PATH . '/helper/brand_helper.php');
- class TestAccountHelper extends TestCase
- {
- public static function setUpBeforeClass() : void
- {
- Base::run_util();
- }
- public function testInviteBonus()
- {
- account_helper::invite_bonus(36490);
- }
- public function testEvaluate()
- {
- account_helper::onAsyncOrderEvaluate();
- }
- public function testGainSystem()
- {
- account_helper::gain_system(36490, 4.5);
- }
- public function testGainBonus()
- {
- account_helper::gain_bonus(36490,36485,4.5);
- }
- public function testLostBonus()
- {
- account_helper::gain_bonus(36490,36485,4.5);
- }
- public function testOnRegister()
- {
- account_helper::onRegister(36490,session_helper::relay_id());
- }
- public function testOrderCancel()
- {
- account_helper::order_cancel('8000000000001603',36490);
- }
- public function testPayRefund()
- {
- //account_helper::pay_refund(36490,500,'退款红包');
- }
- public function testPaysuccess()
- {
- $pay_sn = '910510761110261481';
- account_helper::onAsyncOrderPaied($pay_sn);
- }
- public function testOrderSuccessSys()
- {
- $mod = Model('order');
- $pay_sn = '910510761110261481';
- $order_info = $mod->getOrderInfo(['pay_sn' => $pay_sn]);
- $logic_order = Logic('order');
- $result = $logic_order->changeOrderStateReceive($order_info,'system','系统','超期未收货系统自动完成订单');
- }
- public function testUpfile()
- {
- $file = '/Users/stanley-king/work/PHPProject/shopnc/data/upload/uploadtmp/20161215081131-53be4be9-fe01-50e7-28c0-ded900c9a0f6.jpg';
- $ext = exif_imagetype($file);
- $exif = image_type_to_mime_type($ext);
- $tagnmae = exif_tagname($ext);
- $info = new SplFileInfo($file);
- $type = $info->getType();
- $type = $info->getExtension();
- $size = $info->getSize();
- $tmp_name = $info->getFilename();
- }
- public function testTask()
- {
- account_helper::onAsyncBroadcastOrder('290563492188164623',0.1,30);
- }
- }
|