|
@@ -282,6 +282,32 @@ class TestRedis extends TestCase
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public function testSec()
|
|
|
+ {
|
|
|
+ $cur_min = 0;
|
|
|
+ while(true)
|
|
|
+ {
|
|
|
+ for ($i = 0; $i < 61; $i++) {
|
|
|
+ $cur_time = time();
|
|
|
+ $time_sec = $cur_time;
|
|
|
+ $next_min = $time_sec - $time_sec % 60;
|
|
|
+
|
|
|
+ if($next_min > $cur_min && $time_sec % 60 == 3) {
|
|
|
+ $cur_min = $next_min;
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ sleep(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $a = strftime("%Y-%m-%d %H:%M:%S",$cur_time);
|
|
|
+ $b = strftime("%Y-%m-%d %H:%M:%S",$time_sec);
|
|
|
+ $c = strftime("%Y-%m-%d %H:%M:%S",$cur_min);
|
|
|
+ $d = strftime("%Y-%m-%d %H:%M:%S",$next_min);
|
|
|
+
|
|
|
+ Log::record("cur_time={$a},time_sec={$b},cur_min={$c},next_min={$d}",Log::DEBUG);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
////docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRedis::testCancel)( .*)?$/" --test-suffix TestRedis.php /var/www/html/test
|
|
|
////docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRedis::testCancelPayed)( .*)?$/" --test-suffix TestRedis.php /var/www/html/test
|
|
|
public static function tearDownAfterClass() : void
|