Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
system.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Jan 2016 at 08:40 UTC
Updated:
19 Oct 2017 at 21:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
oriol_e9gComment #3
chx commentedComment #5
chx commentedGrr!
Comment #6
wim leersWow, great find! Looks like a sane (and simple!) fix. Still needs test coverage though.
Comment #7
chx commentedComment #8
tim.plunkettFor those concerned: hook_path_update/hook_path_insert was already passing the $path, it just wasn't used here.
This is a nice trick. +1
I've never once used this. I don't think it's needed (i.e., it is automatic)? If you don't have these, and the code does something to violate the shouldBeCalledTimes() expectations, doesn't the test fail
Comment #9
chx commentedSure, the test fails without checkProphecyMethodsPredictions but at the same time your assert count goes up if it's there. So, I dunno, I'd rather keep it. Explicit is better than implicit.
Comment #10
dawehnerThe reason why you need to call
checkProphecyMethodsPredictionsis because you have 1 test for 3 different things.Just split it up, then you don't need to deal with that.
Comment #11
chx commentedSplitting saves us little: you need to insert to update and to delete. And it has nothing to do with the checkProphecyMethodsPredictions calls. The reason I didn't want to remove it was -- it's not in the destructor so I didn't see clearly how it gets checked and the byzantine overengineered phpunit is makes it very hard to find where it is but actually phpunit does the same check eventually. Sane people would expect it in tearDown where the phpspec docs recommend it but phpunit, no, for some bizarre reason it calls TestResult::run (why does the result run the test?) which eventually threads its way back to the TestCase::runBare where runBare has a verifyMockObjects which since 3.5.0 also happens to verify prophecies despite its name. So much fun...
Removed the explicit calls. I am glad this is well documented.
Comment #12
dawehnerSeems alright for me now. Splitting it up would be nice but I see the point of being a bit of pointless.
Comment #13
alexpottCommitted 9aff04c and pushed to 8.0.x and 8.1.x. Thanks!
Comment #16
wim leersPer IS.
Comment #18
zaporylieI have created a very simple followup to this old-ish issue: #2917505: Drupal\Tests\system\Kernel\PathHooksTest uses incorrect @group