<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 簡介 如果是laravel項目,在命令行運行 vendor/bin/phpunit 就可以看到 他的配置文件在項目根目錄下的phpunit.xml 看tests目錄有Feature和Unit Feature是相當于洋蔥從里面往外面擴散,相當于瀏覽器訪問 Unit是相當于洋蔥從外往里面剝,做了很多斷言 https://phpunit.de/manual/current/zh_cn/writing-tests-for-phpunit.html # 編寫單元測試 ~~~ 在Feature目錄下創建個測試文件 php artisan make:test XXTest 在tests目錄下創建個測試文件 php artisan make:test XXTest --unit ~~~ 我們在tests/Unit下新建個php文件IndexTest.php,命名規則是你要測試的類名+Test,然后這個類繼承TestCase ~~~ namespace Tests\Unit; use App\Index; use Tests\TestCase; class IndexTest extends TestCase { //方法名是test開頭 public function testName() { $index=new Index('hello'); //判斷值等不等于'hello' $this->assertEquals('hello',$index->name()); } } ~~~ 除了方法前面加test,還有種注釋`/** @test */`,也能讓phpunit認識 ~~~ /** @test */ public function Name() { $index=new Index('hello'); $this->assertEquals('hello',$index->name()); } ~~~ ## 只測試其中的一個方法或類 ~~~ vendor/bin/phpunit --filter testName ~~~ 后面跟你要測試的方法名 --- ~~~ vendor/bin/phpunit --filter IndexTest ~~~ 后面跟你要測試的類名
                  <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>

                              哎呀哎呀视频在线观看