PHPUnit - Error?

I'm new to PHPUnit. Can someone tell me what this means?

Class 'PHPUnit_Framework_MockObject_Matcher_InvokedRecorder' not found

39 comments
Comment actions Permalink

I'm running with the PHPStorm GUI, I was just testing to try to find out why it wouldn't work.

0
Comment actions Permalink

OK, let's assume you have your project in "C:\Projects\MySite" & you keep your test files in "tests" subfolder. If you need just 1 config/1 bootstrap file, you just should name them phpunit.xml & bootstrap.php and put in "C:\Projects\MySite\tests\" folder and PHPUnit should pick them up automatically (it is true at least for phpunit.xml).

In your phpunit.xml file you can reference your bootstrap file as simple as this (without mentioning full path):

<?xml version="1.0"?>
<phpunit
    bootstrap="./bootstrap.php">
    ...
</phpunit>
0
Comment actions Permalink

I see. I would recommend to run the tests from command line using phpunit command for the time being (since you are having all these problems) -- in case PhpStorm has errors in their implementation.

0
Comment actions Permalink

I don't think that that method is going to work. None of my tests are in /phpunit. They are all in /phpunit/library/classes and /phpunit/library/classes/apps (too many test files and I want the test folder structure to mimic the real one.)

0
Comment actions Permalink

I was able to get my bootstrap to work across these different folders like this:

$_SERVER["DOCUMENT_ROOT"]     = str_replace("\\phpunit", "", __DIR__)."\\";

0
Comment actions Permalink

I think it is a matter of organizing the stuff properly. For example, have a look at Phing's test suite (how they did it, their directory structure) -- they have only 1 config file and 1 bootstrap file, but their test files are somewhere in 3-level deep folders.

0
Comment actions Permalink

So, the only thing that each team member has to do now is set the phpunit.xml file (tried to get it to pick up automatic

ally, but no go), in the runConfiguration. All the files are now transportable!

0
Comment actions Permalink
So, the only thing that each team member has to do now is set the phpunit.xml file (tried to get it to pick up automatically, but no go), in the runConfiguration

It will pick it up automatically for sure (confirmed in manual) if using phpunit command (command must be invoked from the same folder where config file is located). If you run it via PhpStorm, then it may not work indeed (that is a custom test runner which most likely has nothing to do with phpunit command -- I have not checked how exactly it works)

All the files are now transportable!

So, is it all working fine now?  Congratulations!!!

0
Comment actions Permalink

yes, and thanks for all your help.

0

Please sign in to leave a comment.