ExampleTest.php 897 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Tests\Unit;
  3. use Tests\TestCase;
  4. class ExampleTest extends TestCase
  5. {
  6. /**
  7. * A basic test example.
  8. *
  9. * @return void
  10. */
  11. public function test_that_true_is_true()
  12. {
  13. $this->assertTrue(true);
  14. }
  15. public function testmyLog() {
  16. myLog('test1111')->info('kkkkk');
  17. }
  18. public function testDate() {
  19. $str = 'php artisan ContentManage:SyncCpSubscribeStatisticDataFromZW --startDate=%s --endDate=%s';
  20. $startDate = '2023-04-01';
  21. $newStr = '';
  22. foreach (range(1, 32) as $i) {
  23. $endDate = date_add(date_create($startDate), date_interval_create_from_date_string('1 day'))->format('Y-m-d');
  24. // dump(sprintf($str, $startDate, $endDate));
  25. $newStr .= sprintf($str, $startDate, $endDate) . "\r\n";
  26. $startDate = $endDate;
  27. }
  28. dump($newStr);
  29. }
  30. }