<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                laravel 單元測試文檔 :https://learnku.com/docs/laravel/8.5/testing/10415#c45cc6 目錄中 根目錄中的test中 ![](https://img.kancloud.cn/58/4d/584d3531860a09a5d9596f9313842364_676x115.png) feature 功能測試(接口相關); unit 單元測試(函數級別的測試) ![](https://img.kancloud.cn/09/83/09833c0ca0df765a07a6a97dbd22b19e_785x504.png) 執行命令為 創建單元測試命令 > `php artisan make:test 目錄` 如下所示 > `php artisan make:test ApiV2/Ad/AdTest ` 命名首字母大寫后綴必須以Test結尾 然后方法 必須test開頭(下劃線風格,或者小駝峰風格) ``` /** * 廣告 */ public function testGetAd() { $param=['cate'=>0,'type'=>0]; $ulr='/v1/ad/get_ad'.'?'.http_build_query($param); $response = $this->auth()->get($ulr); $response->assertStatus(200); } ``` 多學一招: > 其中如果以test文件開頭的方法,不需要斷言可以給方法加上注釋 `@doesNotPerformAssertions` 這樣就不會提示警告 執行測試文件 > ./vendor/bin/phpunit 或者 php artisan test ./vendor/bin/phpunit --testsuite=Unit 指定執行Unit中的 php artisan test --testsuite=Feature 指定執行Feature中的 需要指定目錄或者文件 直接后面接上 如下所示 > ./vendor/bin/phpunit ./tests/Feature/ApiV2/Auth // 只能在 powerShell 窗口,cmd窗口不行 php artisan test ./tests/Feature/ApiV2/Auth // powerShell 窗口,cmd窗口都可以執行并且效果更佳 推薦使用 在windows下面執行 有點講究 如果用cmd的窗口的則會出現下面尷尬情況 ![](https://img.kancloud.cn/f1/80/f180ce842cb9aac09ba70d4da8ce0740_581x68.png) 這時可用 田鍵+x 組合鍵后 會出現 powerShell 窗口的選擇既可以使用
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看