You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a start a simple test, i always get the following error:
Please import Patchwork from a point in your code where no user-defined function,
class or trait is yet defined. composerrequire8af9bf7de4cc77dbd99964afd34dcbac() and
possibly others currently violate this.
/../vendor/antecedent/patchwork/Patchwork.php:94
/../vendor/antecedent/patchwork/Patchwork.php:96
/../vendor/brain/monkey/src/Monkey.php:44
/../vendor/brain/monkey/src/Monkey.php:60
/../tests/src/PluginsFirst/SerialKeyChecker/Test/UnitTestCase.php:13
/../tests/src/PluginsFirst/SerialKeyChecker/Test/SerialKeyCheckerControllerTest.php:12
When i force Patchwork version to be 1.4.0 in composer.json, everything seems fine.
Local test setup
My test setup is basically the following. I call it using a phpunit.xml and phpunit command.
Unit-Test:
use Brain\Monkey;
class UnitTestCase extends \PHPUnit_Framework_TestCase
{
protected $fixture;
public function setUp()
{
Monkey::setUpWP();
}
public function tearDown()
{
Monkey::tearDownWP();
}
}
Test-Case:
class SerialKeyCheckerControllerTest extends UnitTestCase
{
public function setUp()
{
parent::setUp();
}
/*
* Tests for __construct()
*/
public function testConstructor()
{
}
}
The text was updated successfully, but these errors were encountered:
k00ni
changed the title
Error: Please import Patchwork from a point in your code where no user-defined function, class or trait is yet defined.
Error: Please import Patchwork from a point in your code where no user-defined function, class or trait is yet defined. (BrainMonkey + PHPUnit)
Feb 15, 2016
Problem
Overview:
I have a minimal setup with:
After a start a simple test, i always get the following error:
When i force Patchwork version to be 1.4.0 in composer.json, everything seems fine.
Local test setup
My test setup is basically the following. I call it using a phpunit.xml and
phpunit
command.Unit-Test:
Test-Case:
composer.json:
The text was updated successfully, but these errors were encountered: