Skip to content

Rector requires phpunit installed to work correctly #1812

@slepic

Description

@slepic

PHP version 7.2.19

Rector version: 0.5.9

Full Command: vendor/bin/rector process app --level php72 --autoload-file app/bootstrap.php
(the bootstrap.php file loads the vendor/autoload.php and inits nette robot loader and container, I do not want to say anymore at this point, since it is a private project)

Environment: phpunit/phpunit is not installed - not in require, nor require-dev section of compoesr.json of the project being processed by rector.

Current behaviour:
Error: Analyze error: Class PHPUnit\\Framework\\TestCase was not found while trying to analyse it on every source file in the project.

Expected behaviour:
OK - no files changed, or maybe some files changed yes, but no error.

Additional information:
if i do
composer require --dev phpunit/phpunit
and rerun the rector command, I get expected behaviour.

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