內容簡介
此外掛可讓您建立單元測試(unit tests)用於您的外掛(plugin),方便您集中運行與檢查測試結果。
從 2.0 版本開始,此外掛已預先安裝 phpunit,因此您只需要安裝此外掛就能立即開始建立單元測試。
此外掛基於 WordPress 自動化系統而開發,同時也是一個外掛,不需要新的資料庫或設定檔,因此當您建立單元測試時,請特別注意您的資料庫訪問權限以保留一致的資料庫結果。
每個單元測試必須擴展(PHPUnit_Framework_TestCase),並包含在 wp-unit 外掛目錄下的 testcase 目錄中。
要運行測試,請到管理面板中的 Unit Testing 選單,並按下 Run 按鈕。測試結果將顯示在同一頁面上。
歡迎隨時聯繫我們,提出任何反饋意見。
外掛標籤
開發者團隊
原文外掛簡介
Enables you to create unit tests for your plugins, run and check the results in a centralized way.
Since version 2.0 it has phpunit bundled in so all you need to get started with unit testing is to install this plugin.
Its based on the WordPress automated system but distributed as a plugin. Also it does not require a new database and a new configuration file so when you create your unit tests pay special attention to your database access so you keep a consistent database.
Every unit test must extend PHPUnit_Framework_TestCase and be included in the testcase directory you will find under the wp-unit plugin directory.
To run the tests go to the Unit Testing menu in the admin panel and press the Run buttom. The results will be displayed on the same page.
Feel free to give us some feedback.
