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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                在路徑`tp5/application/index/controller/Index.php`中新建一個test的操作: ~~~ <?php namespace app\index\controller; class Index { public function index() { ... } public function test(){ return 'Hello world!'; } } ~~~ 在tests目錄下新建一個`IndexTest.php`的測試用例類,并在其中鍵入一下的代碼: ~~~ <?php namespace tests; class IndexTest extends TestCase { public function testTest() { $this->visit('/index/index/test')->see('Hello world!'); } } ~~~ 該測試用例是繼承ThinkPHP單元測試擴展類TestCase的。該類提供了多個用于支持ThinkPHP進行單元測試的方法。 其中,visit方法是接受一個作為URI的參數模擬向ThinkPHP框架中的某個測試發起請求。 而see方法則是斷言輸出的結果是否符合一個正則表達式,其中第一個參數為要匹配的正則表達式,第二個參數的值為true時斷言正則表達式不出現在結果中,為false時斷言正則表達式出現在結果中,默認為false。 輸入一下命令,進行測試: > php think unit 這條命令需要在ThinkPHP根目錄下運行, ~~~ D:\phpStudy\WWW\workspace\DragonApi>php think unit PHPUnit 4.8.36 by Sebastian Bergmann and contributors. ... Time: 561 ms, Memory: 5.75MB OK (2 tests, 4 assertions) ~~~ 在結果的最后一行中,顯示OK,說明所有的測試用例都測試通過了,在括號中的內容是表示有2個測試用例類,4個斷言被測試了。之所以有2 tests是因為tests目錄下還有一個ExampleTest.php的測試類。而 4 assertions則表明是有四個測試用例。 當我們把 ~~~ $this->visit('/index/index/test')->see('Hello world!'); ~~~ 修改成 ~~~ $this->visit('/index/index/test'); ~~~ 可以發現,現在的assertions只剩下三個了。因此,可以得知visit內部也有斷言。
                  <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>

                              哎呀哎呀视频在线观看