phpunit 装配

WBOY
풀어 주다: 2016-06-13 12:18:04
원래의
875명이 탐색했습니다.

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.
#
注意执行时的文件路径不可以有下划线。
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!