after the installation of phpunit-bridge with the composer require --dev symfoy/phpunit-bridge
, the console send the following information:
*Write test cases in the test/folder
*Run php bin/phpunit
As I have good manners, I followed the rules and execute:
php bin/phpunit
and I get no test but#!/usr/bin/env php
./bin/phpunit
(as sugested in the doc) and I get no test but#!/usr/bin/env php
Can anyone explain me what I am doing wrong ?
as asked I add the content of the PHPUnit.xml.dist
file:
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="config/bootstrap.php"
>
<php>
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
and my test folder structure:
_ tests
|
|_ Controller
|
|_ BlogControllerTest.php
EDIT :
I've reinstall everything from scratch and if I don't create the phpunit.xml file, I get the -help
output of the phpunit
command (normal behavior I imagine), So I think that the problem comes from my phpunit configuration.
#!usr/bin/env php
– Pierrick Rambaud#!usr/bin/env php
is just the first line of the phpunit binary. What isphp -v
? – tchapPHP 7.1.12 (cli) (built: Nov 27 2017 15:53:40) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
– Pierrick Rambaudbin/phpunit
file and replace the first line with#!/usr/bin/env php
(notice the added slash) ? – tchap