私はSymfonyプロジェクトに取り組んでいます。単体テストを行う必要があるので、私はPhpunit 6.2.4をダウンロードしてWebサイトからインストールしました。私は自分のデータベースを更新しようとしたときに はしかし、私は他のコンソールコマンドを試してみました。この出力PhpunitはすべてのSymfonyコンソールコマンドをテストしようとしています
php bin/console doctrine:schema:update --dump-sql
PHPUnit 6.2.4 by Sebastian Bergmann and contributors.
unrecognized option --dump-sql
bin/console doctrine:schema:update
Cannot open file "doctrine:schema:update.php".
を得たが、結果は同じです。基本的には、私の推測では、何とかPhpunitがすべての単一ファイルをテストしようとしていたので、他のプロジェクトで働いていた以前のものを使ってphpunit.xmlファイルを編集しました。
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="app/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
<server name="KERNEL_DIR" value="app/" />
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory suffix=".php">tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory>src/*Bundle/Resources</directory>
<directory>src/*/*Bundle/Resources</directory>
<directory>src/*/Bundle/*Bundle/Resources</directory>
</exclude>
</whitelist>
<blacklist>
<directory>bin</directory>
<directory>docker</directory>
</blacklist>
</filter>
</phpunit>
は、私の知る限りでは、ブラックリストbinとドッキングウィンドウ両方のディレクトリは、PHPUnitがそれらの内部は何も実行していないになるはずであるが、それはまだ動作しません。
次にsymfony/phpunit-bridge用のcomposer.jsonを確認して削除してもう一度やり直しましたが、問題は続いています。
誰もこれに直面しましたか?
これはパフォーマンス上の問題ではなく、Phpunitはすべてのコマンドをテストしようとしており、doctrine:schema:updateなどのパラメータをPHPファイルと見なしています。 – Trickylastname