Skip to content

Patchwork warning when included in PHPUnit bootstrap #38

@cmounce

Description

@cmounce

I have a PHPUnit bootstrap file that looks like this:

<?php
require_once('./vendor/antecedent/patchwork/Patchwork.php');
require_once('./vendor/autoload.php');
// other stuff...

Patchwork is the first file included. But when I run "phpunit" from the command line, I get the message:

PHP Warning: Please import Patchwork from a point in your code where no user-defined function, class or trait is yet defined. composer\autoload\includefile() and possibly others currently violate this. in /home/cmounce/Documents/patchwork-phpunit/vendor/antecedent/patchwork/Patchwork.php on line 93

This is happening with Patchwork 1.4.1. Both PHPUnit and Patchwork are Composer dependencies of the project:

{
    "require-dev": {
        "phpunit/phpunit": "^4.8",
        "antecedent/patchwork": "1.4.1"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions