如何使用MAMP在Mac上安装phpunit

如何使用MAMP在Mac上安装phpunit

本文介绍了如何使用MAMP在Mac上安装phpunit 3.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在带有MAMP的Mac OS X上安装PHPUnit 3.5.我确实通过MAMP的PEAR安装了PHPUnit 3.5.这一切都正确,并且phpunit位于/Applications/MAMP/bin/php5.3/lib/php/PEAR/PHPUnit中.可执行文件位于/Applications/MAMP/bin/php5.3/bin/.

I'm trying to install PHPUnit 3.5 on Mac OS X with MAMP. I did install PHPUnit 3.5 via PEAR of MAMP. This is all correctly and phpunit is located /Applications/MAMP/bin/php5.3/lib/php/PEAR/PHPUnit. The executable is located in /Applications/MAMP/bin/php5.3/bin/.

但是当我想执行phpunit时,它什么也没做,即使我确实在MAMP php的bin文件夹中执行它.

But when I want to execute phpunit it doesn't do anything, even when I do execute it in the bin folder of MAMP php.

有人可以帮我吗?

更新

哪个phpunit:/Applications/MAMP/bin/php5.3/bin//phpunit

which phpunit: /Applications/MAMP/bin/php5.3/bin//phpunit

哪个梨:/Applications/MAMP/bin/php5.3/bin//pear

which pear: /Applications/MAMP/bin/php5.3/bin//pear

梨子清单已安装的软件包,通道pear.php.net:

pear listInstalled packages, channel pear.php.net:

软件包版本状态

Archive_Tar 1.3.7稳定

Archive_Tar 1.3.7 stable

Console_Getopt 1.2.3稳定

Console_Getopt 1.2.3 stable

梨1.9.1稳定

Structures_Graph 1.0.3稳定

Structures_Graph 1.0.3 stable

XML_Util 1.2.1稳定

XML_Util 1.2.1 stable

phpunit的内容

#!/Applications/MAMP/bin/php5.3/bin/php
<?php

require_once 'PHP/CodeCoverage/Filter.php';
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'PHPUNIT');

if (extension_loaded('xdebug')) {
    xdebug_disable();
}

if (strpos('/Applications/MAMP/bin/php5.3/bin/php', '@php_bin') === 0) {
    set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
}

require_once 'PHPUnit/Autoload.php';

define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main');

PHPUnit_TextUI_Command::main();

推荐答案

which phpunitwhich pearpear list的输出是什么?

您还使用--alldeps选项安装了phpunit吗?

Also did you install phpunit with the --alldeps option?

这篇关于如何使用MAMP在Mac上安装phpunit 3.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 18:59