<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 跳過測試 并非所有測試都能在任何環境中運行。比如說,考慮這樣一種情況:一個數據庫抽象層,針對其所支持的各種數據庫系統有多個不同的驅動程序。針對 MySQL 驅動程序的測試當然只在 MySQL 服務器可用才能運行。 [Example?7.2, “跳過某個測試”](# "Example?7.2.?跳過某個測試") 展示了一個測試用例類 `DatabaseTest`,它有一個測試方法 `testConnection()`。在測試用例類的 `setUp()`模板方法中,檢查了 MySQLi 擴展是否可用,并且在擴展不可用時用 `markTestSkipped()` 方法來跳過此測試。 **Example?7.2.?跳過某個測試** ~~~ <?php class DatabaseTest extends PHPUnit_Framework_TestCase { protected function setUp() { if (!extension_loaded('mysqli')) { $this->markTestSkipped( 'The MySQLi 擴展不可用。' ); } } public function testConnection() { // ... } } ?> ~~~ 在 PHPUnit 命令行測試執行器的輸出中,被跳過的測試記為 `S`,如下例所示: ~~~ phpunit --verbose DatabaseTest PHPUnit 5.0.0 by Sebastian Bergmann and contributors. S Time: 0 seconds, Memory: 3.95Mb There was 1 skipped test: 1) DatabaseTest::testConnection The MySQLi extension is not available. /home/sb/DatabaseTest.php:9 OK, but incomplete or skipped tests! Tests: 1, Assertions: 0, Skipped: 1. ~~~ [Table?7.2, “用于跳過測試的 API”](# "Table?7.2.?用于跳過測試的 API")列舉了用于跳過測試的 API。 **Table?7.2.?用于跳過測試的 API** | 方法 | 含義 | |-----|-----| | `void markTestSkipped()` | 將當前測試標記為已跳過。 | | `void markTestSkipped(string $message)` | 將當前測試標記為已跳過,并用 `$message` 作為說明信息。 |
                  <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>

                              哎呀哎呀视频在线观看