phpunit test Class' Phar'未找到

时间:2015-05-18 13:26:21

标签: php unit-testing phpunit phar

尝试运行phpunit测试,但是当我运行测试时......

phpunit MyTest.php

...我收到错误:

PHP Fatal error:  Class 'Phar' not found in /usr/local/bin/phpunit on line 611

php手册说Phar is installed by default as of PHP 5.3.0;我正在使用PHP 5.3.17。如何解决此错误?

修改

php -i | grep Phar

什么都不返回。

1 个答案:

答案 0 :(得分:0)

我错过了phar php5 extension module

在cli中:

sudo yast //I'm using OpenSUSE, use whatever package manager your OS requires

然后进行软件管理,搜索' phar'这是我出现的唯一选择。您现在应该可以在php信息中看到Phar

php -i | grep Phar

Phar
Phar: PHP Archive support => enabled
Phar EXT version => 2.0.1
Phar API version => 1.1.1
Phar-based phar archives => enabled
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.