>  기사  >  백엔드 개발  >  phpunit 装配

phpunit 装配

WBOY
WBOY원래의
2016-06-13 12:18:04877검색

phpunit 安装
详细的安装步骤看官方文档,这里主要介绍遇到的问题。
为了生成分析报告:安装了 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.
#
注意执行时的文件路径不可以有下划线。
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.