Forráskód Böngészése

add some test file

stanley-king 4 éve
szülő
commit
20113b6339

+ 1 - 1
mobile/control/index.php

@@ -72,7 +72,7 @@ class indexControl extends specialControl
             $tabs[] = ['special_id' => 1025,'name' => '护肤'];
             $tabs[] = ['special_id' => 1035,'name' => '彩妆'];
             $tabs[] = ['special_id' => 1036,'name' => '洗护'];
-            $tabs[] = ['special_id' => 1019,'name' => '男士'];
+            $tabs[] = ['special_id' => 886,'name' => '男士'];
         }
         else {
             $tabs = index_tab::instance()->tabs();

+ 1 - 1
test/TestAddData.php

@@ -607,6 +607,6 @@ class TestAddData extends TestCase
 
 //docker-compose -f ./docker-compose-dev.yml run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAddData::testCancelOrder)( .*)?$/" --test-suffix TestAddData.php /var/www/html/test
 //docker-compose -f ./docker-compose-dev.yml run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAddData::test20200821_addCard)( .*)?$/" --test-suffix TestAddData.php /var/www/html/test
-//docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAddData::test20201013_addCard)( .*)?$/" --test-suffix TestAddData.php /var/www/html/test
+//docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAddData::test20201013_01_addCard)( .*)?$/" --test-suffix TestAddData.php /var/www/html/test
 //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAddData::testModifyCardno)( .*)?$/" --test-suffix TestAddData.php /var/www/html/test
 

+ 7 - 2
test/TestAlgorithm.php

@@ -7,12 +7,17 @@
  * Time: 上午1:20
  */
 
-define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
+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/algorithm.php');
 
-class TestAlgorithm extends PHPUnit_Framework_TestCase
+use PHPUnit\Framework\TestCase;
+
+class TestAlgorithm extends TestCase
 {
     public function testSearch()
     {

+ 1 - 1
test/TestMemberCard.php

@@ -207,7 +207,7 @@ class TestMemberCard extends TestCase
         }
     }
 
-    //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestMemberCard::testAddMemberCardForinvite)( .*)?$/" --test-suffix TestMemberCard.php /var/www/html/test
+    //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestMemberCard::testAddMemberCard)( .*)?$/" --test-suffix TestMemberCard.php /var/www/html/test
 
 
     public function testDeduct()

+ 25 - 9
test/TestPay.php

@@ -6,25 +6,27 @@
  * Date: 16/6/15
  * Time: 下午3:12
  */
+declare(strict_types=0);
 
+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');
 
-define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
-
-require_once (BASE_ROOT_PATH . '/fooder.php');
 require_once (BASE_ROOT_PATH . '/helper/util_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/pay/IPay.php');
 require_once (BASE_ROOT_PATH . '/helper/pay/aopay.php');
 require_once (BASE_ROOT_PATH . '/core/framework/function/http.php');
 
-class TestPay extends PHPUnit_Framework_TestCase
+use PHPUnit\Framework\TestCase;
+
+class TestAddData extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass() : void
     {
         Base::run_util();
     }
-    public static function tearDownAfterClass()
-    {
-    }
 
     public function testAdd()
     {
@@ -76,6 +78,20 @@ class TestPay extends PHPUnit_Framework_TestCase
 <trade_type><![CDATA[MWEB]]></trade_type>
 <transaction_id><![CDATA[4200000279201902260421273158]]></transaction_id>
 </xml>^M';
-        $resp = http_post_data('https://passport.lrlz.com/mobile/web_wxnotify.php',$body);
+        $resp = http_post_data('https://www.xyzshops.cn/mobile/web_wxnotify.php',$body);
+    }
+
+    public function testPostData()
+    {
+        $msg = "1柜门1箱门,取件码59368";
+        $postData['orderCode'] = '4312431431431265900431';
+        $postData['boxMsg'] = $msg;
+
+        $count = 1000;
+        do{
+            $resp = http_post_data('https://yxmall-adminportal.eavic.com/oms-web/box/deliver',json_encode($postData));
+            Log::record($resp,Log::DEBUG);
+        }
+        while($count--);
     }
 }

+ 21 - 4
test/TestTime.php

@@ -7,15 +7,20 @@
  * Time: 上午10:21
  */
 
-define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
+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/stat_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/stat_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/util_helper.php');
 
-class TestTime extends PHPUnit_Framework_TestCase
+use PHPUnit\Framework\TestCase;
+class TestTime extends TestCase
 {
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass() : void
     {
         Base::run_util();
     }
@@ -24,7 +29,7 @@ class TestTime extends PHPUnit_Framework_TestCase
     {
         $date = date('Y-m-d H:i:S',1517399862);
 
-        $tm = strtotime('2017-08-01 3:43:00');
+        $tm  = strtotime('2017-08-01 3:43:00');
         $tm1 = strtotime('2017-8-01 3:43:00');
         $tm2 = strtotime('2017-08-1 3:43:00');
         $tm3 = strtotime('2017-8-1 3:43:00');
@@ -75,6 +80,18 @@ class TestTime extends PHPUnit_Framework_TestCase
         $delta = $usable_time - $cur_time;
     }
 
+    public function testRange()
+    {
+        $ltm = localtime(strtotime('2020-09-28'),true);
+
+    }
+
+    private function year_day()
+    {
+        $ltm = localtime(strtotime('2020-09-28'),true);
+        return $ltm['tm_yday'];
+    }
+
     public function testMtrand()
     {
         for ($i = 0; $i < 100; $i++) {