我试图通过Mac(10.10.5)上的符号链接运行phpunit
。
Composer是自我更新的(c85894e7920c5e83d93d88b541bc4ebf
), phpunit版本为"4.4.5"。
我有如下的文件结构(简化):
'library
'composer
'vendor
'bin
'phpunit (symlink to '../phpunit/phpunit/phpunit')
'phpunit
'phpunit
'phpunit (executable)
'composer.json
'composer.lock
'composer.phar
'tests
'phpunit (symlink to '../library/composer/vendor/bin/phpunit')
'phpunit.bootstrap.php (contains bootstrap logic)
'phpunit.xml (see below)
phpunit.xml
文件包含以下内容:
<phpunit backupGlobals="true"
backupStaticAttributes="false"
bootstrap="phpunit.bootstrap.php"
cacheTokens="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
mapTestClassNameToCoveredClassName="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
strict="true"
verbose="true">
</phpunit>
- 当我运行
php tests/phpunit
时,它显示了我的手册。 - 当我运行
php tests/phpunit .
时,它在composer/vendor
文件夹中瞄准并运行测试。 - 当我运行
php tests/phpunit unit/*
它的工作,但只有unit
文件夹下的内容,当然。如何使tests'phpunit
直接在符号链接文件目录下运行所有测试?
尝试从编写器中删除phpunit。创建composer update
文件,然后将其添加到您的编写器中。创建composer update
我在使用PHPUnit和Lumen时遇到了同样的问题,这个解决方案修复了它。
phpunit
命令现在可以在根目录下工作了