소스 검색

test(miniapp): 更新小程序测试方法

- 使用 PHPUnit 10 的 `#[Test]` 属性替换旧的测试注释方式
- 重命名测试方法为 `getwxacodeunlimit` 以匹配实际调用接口
- 调整代码格式,提升可读性
runphp 4 달 전
부모
커밋
9fdcf058a3
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      tests/Service/MiniAppTest.php

+ 5 - 2
tests/Service/MiniAppTest.php

@@ -1,24 +1,27 @@
 <?php
 declare(strict_types=1);
+
 namespace SixShop\Wechat\Service;
 
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class MiniAppTest extends TestCase
 {
     private MiniApp $miniApp;
+
     protected function setUp(): void
     {
         $this->miniApp = app(MiniApp::class);
     }
 
-    public function test()
+    #[Test]
+    public function getwxacodeunlimit()
     {
         $response = $this->miniApp->getClient()->postJson('/wxa/getwxacodeunlimit', [
             'scene' => 'invite_code=' . 1234,
             'check_path' => false,
             'env_version' => 'develop'
         ]);
-
     }
 }