Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
phpunit
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Dec 2013 at 13:13 UTC
Updated:
29 Jul 2014 at 23:13 UTC
Jump to comment: Most recent
Comments
Comment #1
xanoPHPUnit 3.7 has the inconsistently named
getObjectForTrait(). This seems to return a dumb object and not a mock that you can set expectancies and behavior on.Comment #2
chx commentedI support PHPunit 3.8, I reaaaaaally don't support going above 5.4.4 where Debian Wheezy is http://packages.debian.org/wheezy/php5. Raised https://github.com/sebastianbergmann/phpunit/issues/1075 . Also I wonder what PHP 5.4 do the testbots run.
Comment #3
xanoIf we have to ship with PHPUnit 3.7, we can always test traits by making dummy classes that use them. It's not as clean and straightforward as testing traits directly, but at least it won't be impossible.
Comment #4
chx commentedPHPunit 3.8 will likely be 5.5 by the time it releases for traits see http://blog.florianwolters.de/educational/2012/09/20/Testing-Traits-with... .
Comment #5
xanoLet's keep this open for a little longer, if only to create awareness for the fact that with PHPUnit 3.7 we can't test traits directly. Also, the discussion on Github is still ongoing.
Comment #6
chx commentedTraits can not be tested "directly" as they are not classes. We need a better issue summary than what we have now -- cos for sure phpunit can test traits and also for sure we will not go above Debian stable unless the sky is falling. A better process proposal can be found at https://drupal.org/comment/8291069#comment-8291069
Comment #7
cosmicdreams commentedSince PHPUnit 4.0 was just released today, ( https://github.com/sebastianbergmann/phpunit/wiki/ChangeLog-for-PHPUnit-4.0 ) Should we shift the focus of this issue to upgrading to PHPUnit 4?
Comment #8
webchickProbably, yes.
Also, unless I'm mis-reading (which is very possible), https://github.com/sebastianbergmann/phpunit/blob/master/composer.json shows a min. PHP requirement of PHP 5.3.3, not PHP 5.4.7? If so, that'd be great. I'd really rather not increase our PHP version to something that the vast majority of active Linux distros don't support just for unit testing, which approximately 0.0000005% of our overall users will ever touch.
Comment #9
longwavePHPUnit seems to have dropped their requirement from PHP 5.4.7 down to PHP 5.3.3 in https://github.com/sebastianbergmann/phpunit/commit/c4ae04b949daad9c9858...
Comment #10
longwaveComment #11
longwavePHPUnit 4 has removed staticExpects(), so AccessManagerTest, EntityManagerTest and ReverseProxySubscriberUnitTest will need some refactoring to work around this.
Comment #12
cosmicdreams commentedI should probably mark #2114823: Update PHPUnit to 4.x as a duplicate if we're going to do this here.
Comment #13
webchickThat one's older, so let's close this as a dupe.