This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
Object passed by reference are not handled properly #116
Comments
Thanks for the detailed bug report. This seems related to sebastianbergmann/phpunit#796, but I can't reproduce it yet. Can you provide the following information:
|
I installed PHPUnit with composer. $ php -v
PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 24 2012 17:45:44)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies $ ./vendor/bin/phpunit --version
PHPUnit 3.7.13 by Sebastian Bergmann. You can see failures here: One of the failing tests: Related code:
To reproduce, use the following composer.json file to install Symfony's form component: {
"require": {
"symfony/form": "2.1.*@dev",
"phpunit/phpunit": "3.7.13"
},
"config": {
"bin-dir": "bin/"
}
} and run the following test: ./bin/phpunit vendor/symfony/form/Symfony/Component/Form/Tests/CompoundFormTest.php It passes with PHPUnit 3.7.10 but fails with 3.7.13. |
Thanks, @jakzal. I'll look into this ASAP. |
Alright, it seems to work in PHP 5.4, but fail in PHP 5.3. I'll have a fix for this shortly. |
whatthejeff
added a commit
to whatthejeff/phpunit-mock-objects
that referenced
this issue
Jan 30, 2013
* Added tests for sebastianbergmann/phpunit#798.
@sebastianbergmann, I believe this can be closed now. |
sebastianbergmann
pushed a commit
to sebastianbergmann/phpunit
that referenced
this issue
Feb 6, 2013
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Following test was passing before fixing the #81 in de6d32a8474704e71ce099d1762c69a76eca4b30
Notice that first argument to the callback is an object and it's passed by reference. Test fails with:
I realize objects are passed by reference anyway and defining references in the method signature is not needed. However, this is a valid scenario if a method accepts either object or array.
The text was updated successfully, but these errors were encountered: