溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

yii 和 zend studio 集成

發布時間:2020-05-18 11:36:48 來源:網絡 閱讀:1774 作者:kingzeus 欄目:web開發

yii是基于測試驅動的,而zend studio是一個好用的ide。集成就是必須的。

本文適合喜歡使用ide的開發者,vim用戶或者文本編輯器使用者請忽略。

本文使用的是最新的zend studio (版本 10.0.0)官網下載

yii本身沒啥可說的,主要還是phpunit相關的內容。

  • 創建完項目,寫一個簡單的testcase。

[php]
require_once 'test\CTestCase.php';

/**
* Task test case.
*/
class TaskTest extends CTestCase {

public function testNewArrayIsEmpty()
{
$fixture = array();
$this->assertEquals(0, sizeof($fixture));
}
}
[/php]
  • 在 tests 目錄上直接 run as   phpunit test

可以運行,報錯:No test executed, Either a fatal error occurred, the launch was stopped manually or the script execution was halted with a ‘die’/'exit’ statement.
查看輸出:require_once(): Failed opening required 'PHPUnit/Extensions/SeleniumTestCase.php' (include_path='.;C:\Program Files (x86)\Zend\Zend Studio 10.0.0\plugins\com.zend.php.phpunit_10.0.0.201210220951\resources\library\3.6.10\;...........
原因:phpunit默認并沒有Selenium的擴展
解決辦法:

  1. 使用自己的pear安裝的phpunit

  2. 下載一個Selenium的擴展,即可.(下載地址)解壓到phpunit目錄(就是上面輸出里面的地址)的Extensions

  • 再次運行,正常


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女