成都创新互联网站制作重庆分公司

yii和zendstudio集成

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

  • 再次运行,正常


本文名称:yii和zendstudio集成
浏览地址:http://cxhlcq.com/article/igjopd.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部