Skip to content

Require PHPUnit as a dev dependency #13934

@mnapoli

Description

@mnapoli

Yes I know this has been discussed already :) but I'd like to start the discussion again with a nice summary of the arguments that were expressed:

@fabpot in #5748: For me, PHPunit is a tool and I'm not comfortable (yet) about adding this tool dep into the composer file.

PHPUnit is not just a tool, it's also a framework: we use PHPUnit classes to write the tests. So it's not just about downloading and running a phar, it's also about installing the code so that we can use it like any framework/library.

As a more concrete example, PHPUnit 4.5 has added important new features to the test framework and only by requiring it in Composer can you make sure people install the latest version.

@stof in #12136: Adding phpunit as a dev requirement means that each Travis build has to install 15 more composer packages (phpunit is not a small dependency)

@pborreli mentions this in #5748: "indeed, build takes 1 second more approx, which is not much"

Another reason I've read:

When working with VMs the global include path is not accessible on the host machine

For me autocompletion & co is completely broken because the IDE can't find the PHPUnit framework classes. It's much harder to work with tests. And by adding the global tools (i.e. global composer install) to PhpStorm I now have a lot of duplicated classes, which trips the IDE even more.

So hopefully we can open this discussion again and add PHPUnit to require-dev in composer.json :)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions