摘要: PHPUnit_Frameworkd_TestCase的断言方法异常的测试可以测试类的方法是否有对某些情况抛出异常 public function testSetGoods_longname() { $this->setExpectedException("Exception"); $this->Goods_obj->SetGoods("双肩包的名字不能太长"); }上例如果在商品名称过长未抛出异常时,测试时会显示错误2) BaoGoodsTest::testSetGoods_longnameFailed asserting that 阅读全文
posted @ 2013-07-09 17:21 见欲不见 阅读(214) 评论(0) 推荐(0) 编辑
摘要: http://pear.phpunit.de/ phpunit官方站点https://github.com/sebastianbergmann/phpunit/ phpunit Github地址phpunit安装命令:pear channel-discover pear.phpunit.depear install -o phpunit/phpunit运行上门的命令安装phpunit,当然必须是你的pear安装良好的情况下如果安装的时候遇到pear/Mail_Mime requires PEAR Installer (version >= 1.9.4), installed versio 阅读全文
posted @ 2013-07-09 16:41 见欲不见 阅读(749) 评论(0) 推荐(0) 编辑