PHPUnit does not work

0

I'm trying to run tests on my project, but PHPUnit does not work! I'm trying to run it, via composer ( vendor/bin/phpunit ). However, nothing happens ... I no longer know what to do to make it work. In other projects, everything works normally.

Output

phpunit.xml

<?xmlversion="1.0" encoding="utf-8"?>
<phpunit bootstrap="./vendor/autoload.php" colors="true">
    <testsuites>
        <testsuite name="Unit Tests">
            <directory>./tests</directory>
        </testsuite>
    </testsuites>
</phpunit> 

composer.json

{
    "name": "giovanni/magic",
    "description": "Magic framework for PHP projects",
    "keywords": ["api", "rest", "framework"],
    "license": "MIT",
    "type": "project",
    "minimum-stability": "stable",
    "require": {
        "php": ">= 7.0",
        "altorouter/altorouter": "^1.2",
        "filp/whoops": "^2.1",
        "illuminate/database": "^5.4",
        "bosnadev/repositories": "^0.13.0",
        "nesbot/carbon": "^1.22",
        "guzzlehttp/guzzle": "^6.3",
        "larapack/dd": "^1.1",
        "phpmailer/phpmailer": "^6.0"
    },
    "authors": [
        {
            "name": "Giovanni Cruz",
            "email": "[email protected]"
        }
    ],
    "autoload": {
        "files": ["./config/errors.php", "./config/database.php", "./config/router.php"],
        "psr-4":
        {
            "App\": "./app",
            "App\Models\": "./app/models",
            "App\Controllers\": "./app/controllers",
            "Kernel\": "./kernel"
        }
    },
    "scripts": {
        "serve": [
            "php -S localhost:8000 -t ./public"
        ]
    },
    "require-dev": {
        "phpunit/phpunit": "^6.5"
    }
} 
    
asked by anonymous 17.01.2018 / 16:26

1 answer

0

Hello, have you tried adding the suffix attribute to phpunit.xml ? See the example:

<phpunit bootstrap="vendor/autoload.php" colors="true">
  <testsuites>
    <testsuite name="unit">
      <directory suffix="Test.php">tests/</directory>
    </testsuite>
  </testsuites>
</phpunit>

Your test classes (as well as file names) should also have this suffix: Exemplo1Test to Exemplo1Test.php , Exemplo2Test to Exemplo2Test.php ...

    
17.01.2018 / 17:09