<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                讓我們來瞧瞧以下代碼中命令行測試運行器的各種選項: ~~~ phpunit --help PHPUnit 5.0.0 by Sebastian Bergmann and contributors. Usage: phpunit [options] UnitTest [UnitTest.php] phpunit [options] <directory> Code Coverage Options: --coverage-clover <file> Generate code coverage report in Clover XML format. --coverage-crap4j <file> Generate code coverage report in Crap4J XML format. --coverage-html <dir> Generate code coverage report in HTML format. --coverage-php <file> Export PHP_CodeCoverage object to file. --coverage-text=<file> Generate code coverage report in text format. Default: Standard output. --coverage-xml <dir> Generate code coverage report in PHPUnit XML format. Logging Options: --log-junit <file> Log test execution in JUnit XML format to file. --log-tap <file> Log test execution in TAP format to file. --log-json <file> Log test execution in JSON format. --testdox-html <file> Write agile documentation in HTML format to file. --testdox-text <file> Write agile documentation in Text format to file. Test Selection Options: --filter <pattern> Filter which tests to run. --testsuite <pattern> Filter which testsuite to run. --group ... Only runs tests from the specified group(s). --exclude-group ... Exclude tests from the specified group(s). --list-groups List available test groups. --test-suffix ... Only search for test in files with specified suffix(es). Default: Test.php,.phpt Test Execution Options: --report-useless-tests Be strict about tests that do not test anything. --strict-coverage Be strict about unintentionally covered code. --strict-global-state Be strict about changes to global state --disallow-test-output Be strict about output during tests. --enforce-time-limit Enforce time limit based on test size. --disallow-todo-tests Disallow @todo-annotated tests. --process-isolation Run each test in a separate PHP process. --no-globals-backup Do not backup and restore $GLOBALS for each test. --static-backup Backup and restore static attributes for each test. --colors=<flag> Use colors in output ("never", "auto" or "always"). --columns <n> Number of columns to use for progress output. --columns max Use maximum number of columns for progress output. --stderr Write to STDERR instead of STDOUT. --stop-on-error Stop execution upon first error. --stop-on-failure Stop execution upon first error or failure. --stop-on-risky Stop execution upon first risky test. --stop-on-skipped Stop execution upon first skipped test. --stop-on-incomplete Stop execution upon first incomplete test. -v|--verbose Output more verbose information. --debug Display debugging information during test execution. --loader <loader> TestSuiteLoader implementation to use. --repeat <times> Runs the test(s) repeatedly. --tap Report test execution progress in TAP format. --testdox Report test execution progress in TestDox format. --printer <printer> TestListener implementation to use. Configuration Options: --bootstrap <file> A "bootstrap" PHP file that is run before the tests. -c|--configuration <file> Read configuration from XML file. --no-configuration Ignore default configuration file (phpunit.xml). --include-path <path(s)> Prepend PHP's include_path with given path(s). -d key[=value] Sets a php.ini value. Miscellaneous Options: -h|--help Prints this usage information. --version Prints the version and exits. ~~~ `phpunit UnitTest` 運行由?`UnitTest`?類提供的測試。這個類應當在?`UnitTest.php`?源文件中聲明。 `UnitTest`?這個類必須滿足以下二個條件之一:要么它繼承自?`PHPUnit_Framework_TestCase`;要么它提供?`public static suite()`?方法,這個方法返回一個?`PHPUnit_Framework_Test`?對象,比如,一個?`PHPUnit_Framework_TestSuite`?類的實例。 `phpunit UnitTest UnitTest.php` 運行由?`UnitTest`?類提供的測試。這個類應當在指定的源文件中聲明。 `--coverage-clover` 為運行的測試生成帶有代碼覆蓋率信息的 XML 格式的日志文件。更多細節請參見[第 13 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#logging "第?13?章?Logging (日志記錄)")。 請注意,此功能僅當安裝了 tokenizer 和 Xdebug 這兩個 PHP 擴展后才可用。 `--coverage-crap4j` 生成 Crap4j 格式的代碼覆蓋率報告。更多細節請參見[第 11 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#code-coverage-analysis "第?11?章?代碼覆蓋率分析")。 請注意,此功能僅當安裝了 tokenizer 和 Xdebug 這兩個 PHP 擴展后才可用。 `--coverage-html` 生成 HTML 格式的代碼覆蓋率報告。更多細節請參見?[第 11 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#code-coverage-analysis "第?11?章?代碼覆蓋率分析")。 請注意,此功能僅當安裝了 tokenizer 和 Xdebug 這兩個 PHP 擴展后才可用。 `--coverage-php` 生成一個序列化后的 PHP_CodeCoverage 對象,此對象含有代碼覆蓋率信息。 請注意,此功能僅當安裝了 tokenizer 和 Xdebug 這兩個 PHP 擴展后才可用。 `--coverage-text` 為運行的測試以人們可讀的格式生成帶有代碼覆蓋率信息的日志文件或命令行輸出。更多細節請參見?[第 13 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#logging "第?13?章?Logging (日志記錄)")。 請注意,此功能僅當安裝了 tokenizer 和 Xdebug 這兩個 PHP 擴展后才可用。 `--log-junit` 為運行的測試生成 JUnit XML 格式的日志文件。更多細節請參見?[第 13 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#logging "第?13?章?Logging (日志記錄)")。 `--log-tap` 為運行的測試生成?[Test Anything Protocol (TAP)](http://testanything.org/)?格式的日志文件。更多細節請參見[第 13 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#logging "第?13?章?Logging (日志記錄)")。 `--log-json` 生成?[JSON](http://www.json.org/)?格式的日志文件。更多細節請參見[第 13 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#logging "第?13?章?Logging (日志記錄)")。 `--testdox-html`?和?`--testdox-text` 為運行的測試以 HTML 或純文本格式生成敏捷文檔。更多細節請參見?[第 12 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#other-uses-for-tests "第?12?章?測試的其他用途")。 `--filter` 只運行名稱與給定模式匹配的測試。如果模式未閉合包裹于分隔符,PHPUnit 將用?`/`?分隔符對其進行閉合包裹。 測試名稱將以以下格式之一進行匹配: ~~~ TestNamespace\TestCaseClass::testMethod ~~~ 默認的測試名稱格式等價于在測試方法內使用?`__METHOD__`?魔術常量。 ~~~ TestNamespace\TestCaseClass::testMethod with data set #0 ~~~ 當測試擁有數據供給器時,數據的每輪迭代都會將其當前索引附加在默認測試名稱結尾處。 ~~~ TestNamespace\TestCaseClass::testMethod with data set "my named data" ~~~ 當測試擁有使用命名數據集的數據供給器時,數據的每輪迭代都會將當前名稱附加在默認測試名稱結尾處。命名數據集的例子參見[例 3.1](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#textui.examples.TestCaseClass.php "例 3.1: 命名數據集")。 **例 3.1: 命名數據集** ~~~ <?php namespace TestNamespace; class TestCaseClass extends \PHPUnit_Framework_TestCase { /** * @dataProvider provider */ public function testMethod($data) { $this->assertTrue($data); } public function provider() { return array( 'my named data' => array(true), 'my data' => array(true) ); } } ?> ~~~ `/path/to/my/test.phpt` 對于 PHPT 測試,其測試名稱是文件系統路徑。 有效的過濾器模式例子參見[例 3.2](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#textui.examples.filter-patterns "例 3.2: 過濾器模式例子")。 **例 3.2: 過濾器模式例子** * `--filter 'TestNamespace\\TestCaseClass::testMethod'` * `--filter 'TestNamespace\\TestCaseClass'` * `--filter TestNamespace` * `--filter TestCaseClass` * `--filter testMethod` * `--filter '/::testMethod .*"my named data"/'` * `--filter '/::testMethod .*#5$/'` * `--filter '/::testMethod .*#(5|6|7)$/'` 在匹配數據供給器時有一些額外的快捷方式,參見[例 3.3](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#textui.examples.filter-shortcuts "例 3.3: 過濾器的快捷方式")。 **例 3.3: 過濾器的快捷方式** * `--filter 'testMethod#2'` * `--filter 'testMethod#2-4'` * `--filter '#2'` * `--filter '#2-4'` * `--filter 'testMethod@my named data'` * `--filter 'testMethod@my.*data'` * `--filter '@my named data'` * `--filter '@my.*data'` `--testsuite` 只運行名稱與給定模式匹配的測試套件。 `--group` 只運行來自指定分組(可以多個)的測試。可以用?`@group`?標注為測試標記其所屬的分組。 `@author`?標注是?`@group`?的一個別名,允許按作者來篩選測試。 `--exclude-group` 排除來自指定分組(可以多個)的測試。可以用?`@group`?標注為測試標記其所屬的分組。 `--list-groups` 列出所有有效的測試分組。 `--test-suffix` 只查找文件名以指定后綴(可以多個)結尾的測試文件。 `--report-useless-tests` 更嚴格對待事實上不測試任何內容的測試。詳情參見?[第 6 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#risky-tests "第?6?章?有風險的測試")。 `--strict-coverage` 更嚴格對待意外的代碼覆蓋。詳情參見?[第 6 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#risky-tests "第?6?章?有風險的測試")。 `--strict-global-state` 更嚴格對待全局狀態篡改。詳情參見?[第 6 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#risky-tests "第?6?章?有風險的測試")。 `--disallow-test-output` 更嚴格對待測試執行期間產生的輸出。詳情參見[第 6 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#risky-tests "第?6?章?有風險的測試")。 `--disallow-todo-tests` 不執行文檔注釋塊中含有?`@todo`?標注的測試。 `--enforce-time-limit` 根據測試規模對其加上執行時長限制。詳情參見[第 6 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#risky-tests "第?6?章?有風險的測試")。 `--process-isolation` 每個測試都在獨立的PHP進程中運行。 `--no-globals-backup` 不要備份并還原 $GLOBALS。更多細節請參見[“全局狀態”一節](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#fixtures.global-state "全局狀態")。 `--static-backup` 備份并還原用戶定義的類中的靜態屬性。更多細節請參見[“全局狀態”一節](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#fixtures.global-state "全局狀態")。 `--colors` 使用彩色輸出。Windows下,用?[ANSICON](https://github.com/adoxa/ansicon)?或?[ConEmu](https://github.com/Maximus5/ConEmu)。 本選項有三個可能的值: * `never`: 完全不使用彩色輸出。當未使用?`--colors`?選項時,這是默認值。 * `auto`: 如果當前終端不支持彩色、或者輸出被管道輸出至其他命令、或輸出被重定向至文件時,不使用彩色輸出,其余情況使用彩色。 * `always`: 總是使用彩色輸出,即使當前終端不支持彩色、輸出被管道輸出至其他命令、或輸出被重定向至文件。 當使用了?`--colors`?選項但未指定任何值時,將選擇?`auto`?做為其值。 `--columns` 定義輸出所使用的列數。如果將其值定義為?`max`,則使用當前終端所支持的最大列數。 `--stderr` 選擇輸出到?`STDERR`?而非?`STDOUT`. `--stop-on-error` 首次錯誤出現后停止執行。 `--stop-on-failure` 首次錯誤或失敗出現后停止執行。 `--stop-on-risky` 首次碰到有風險的測試時停止執行。 `--stop-on-skipped` 首次碰到跳過的測試時停止執行。 `--stop-on-incomplete` 首次碰到不完整的測試時停止執行。 `--verbose` 輸出更詳盡的信息,例如不完整或者跳過的測試的名稱。 `--debug` 輸出調試信息,例如當一個測試開始執行時輸出其名稱。 `--loader` 指定要使用的?`PHPUnit_Runner_TestSuiteLoader`?實現。 標準的測試套件加載器將在當前工作目錄和 PHP 的?`include_path`?配置指令中指定的每個目錄內查找源文件。諸如?`Project_Package_Class`?這樣的類名對應的源文件名為?`Project/Package/Class.php`。 `--repeat` 將測試重復運行指定次數。 `--tap` 使用?[Test Anything Protocol (TAP)](http://testanything.org/)?報告測試進度。更多細節請參見?[第 13 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#logging "第?13?章?Logging (日志記錄)")。 `--testdox` 將測試進度以敏捷文檔方式報告。更多細節請參見?[第 12 章](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#other-uses-for-tests "第?12?章?測試的其他用途")。 `--printer` 指定要使用的結果輸出器(printer)。輸出器類必須擴展?`PHPUnit_Util_Printer`?并且實現?`PHPUnit_Framework_TestListener`?接口。 `--bootstrap` 在測試前先運行一個 "bootstrap" PHP 文件。 `--configuration`,?`-c` 從 XML 文件中讀取配置信息。更多細節請參見[附錄 C](https://phpunit.de/manual/current/zh_cn/phpunit-book.html#appendixes.configuration "附錄?C.?XML 配置文件")。 如果?`phpunit.xml`?或?`phpunit.xml.dist`?(按此順序)存在于當前工作目錄并且*未*使用?`--configuration`,將自動從此文件中讀取配置。 `--no-configuration` 忽略當前工作目錄下的?`phpunit.xml`?與?`phpunit.xml.dist`。 `--include-path` 向 PHP 的?`include_path`?開頭添加指定路徑(可以多個)。 `-d` 設置指定的 PHP 配置選項的值。 >[info] ### 注意 > 請注意,從 4.8 開始,選項不能放在參數之后。
                  <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>

                              哎呀哎呀视频在线观看