phpunit 安装

来源:互联网 发布:淘宝小女孩子长裙礼服 编辑:程序博客网 时间:2024/05/24 05:21
详细的安装步骤看官方文档,这里主要介绍遇到的问题。
为了生成分析报告:安装了 xdebug
wget http://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit/
查看是否安装成功
/php5/bin/php phpunit.phar --version
这里操作时报错了。说没有 gmp.soa 文件。
我建了个软链接文件 gmp.soa => gmp.so
解决掉。
这里显示:
PHPUnit 4.6.4 by Sebastian Bergmann and contributors.
表示安装成功了。
下面写个测试示例:
====================
# cat DependencyFailureTest.php 
<?phpclass DependencyFailureTest extends PHPUnit_Framework_TestCase {  public function testOne() {    $this->markTestIncomplete("this is don't done test.");  }  public function testTwo() {  }}


====================
执行代码
/php5/bin/php phpunit.phar /tmp/DependencyFailureTest
PHPUnit 4.6.4 by Sebastian Bergmann and contributors.
I.
Time: 1.15 seconds, Memory: 22.75Mb
OK, but incomplete, skipped, or risky tests!
Tests: 2, Assertions: 0, Incomplete: 1.
#
注意执行时的文件路径不可以有下划线。
0 0