jeudi 25 avril 2019

Probleme with symfony/phpunit-bridge

I'm trying to use phpunit-bridge

I have installed it by this command

 composer require --dev "symfony/phpunit-bridge:*"

This is the composer.json

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "symfony/finder": "4.2.*",
.
.
.
.
...

    },
    "require-dev": {
        "symfony/debug-pack": "*",
        "symfony/maker-bundle": "^1.11",
        "symfony/phpunit-bridge": "4.2.*",
        "symfony/profiler-pack": "*",
        "symfony/test-pack": "*",
        "symfony/web-server-bundle": "4.2.*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.2.*"
        }
    }
}

My problem is any command its work : When i'm using this commands: ./vendor/bin/simple-phpunit or ./bin/phpunit i see this error

'.' n’est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.

But when i'm use :

phpunit --v

PHP Fatal error: Class 'PHPUnit_Framework_BaseTestListener' not found in C:\xampp\htdocs\pfebgfi\vendor\symfony\phpunit-bridge\Legacy\SymfonyTestsListenerForV5.php on line 21

Fatal error: Class 'PHPUnit_Framework_BaseTestListener' not found in C:\xampp\htdocs\pfebgfi\vendor\symfony\phpunit-bridge\Legacy\SymfonyTestsListenerForV5.php on line 21

PS: I'm using Windows

/----------Updated-----------/:

This is phpunit.xml.dist:

<?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" />
        <env name="APP_ENV" value="test" />
        <env 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>

Please anyone can help me to let it work?

Aucun commentaire:

Enregistrer un commentaire