技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

< 2025年6月 >
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 1 2 3 4 5
6 7 8 9 10 11 12

统计

2012年7月3日 #

基于PHPUnit编写第一个测试用例

摘要: common/config.php 常量模块<?php//常量定义define ("SERVER_ADDR","http://127.0.0.1");define ("REGISTER_ADDR",SERVER_ADDR."/open/register");define ("LOGIN_ADDR",SERVER_ADDR."/open/login");define ("APPLY_ADDR",SERVER_ADDR."/open/apply 阅读全文

posted @ 2012-07-03 23:40 codestyle 阅读(795) 评论(0) 推荐(0)

基于PHPUnit编写测试用例

摘要: 环境:ubuntu10.10百度来的例子大多是这样的<?php //test.php 编写了测试用例的PHP文件 require_once('TestCase.php'); class OpenTestCase extends PHPUnit_Framework_TestCase { public function testRegister() { //... } }?>可以通过这样来执行自动化测试$ phpunit test.php报错,提示找不到PHPUnit_Framework_TestCase... 阅读全文

posted @ 2012-07-03 23:26 codestyle 阅读(547) 评论(0) 推荐(0)

Ubuntu上PHPUnit安装

摘要: 什么是PHPUnit?PHPUnit是一个轻量级的PHP测试框架。它是在PHP5下面对JUnit3系列版本的完整移植,是xUnit测试框架家族的一员(它们都基于模式先锋KentBeck的设计)Ubuntu上安装sudoapt-getinstallphpunit验证PHPUnit安装成功,命令行输入phpunit$ phpunit安装成功打印:PHPUnit 3.6.11 by Sebastian Bergmann.Usage: phpunit [switches] UnitTest [UnitTest.php] phpunit [switches] <directory>如果出现如 阅读全文

posted @ 2012-07-03 22:45 codestyle 阅读(614) 评论(0) 推荐(0)

点击右上角即可分享
微信分享提示