Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
system.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Aug 2013 at 22:49 UTC
Updated:
15 Feb 2015 at 10:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mparker17Okay. After some adventures with fatal errors, I've created two patches.
Turns out the original test code made the assumption that it would only run inside it's test harness. Since my method for testing was "enable the hidden module with Drush and hit the menu paths", the result of
$query->execute()would be null and the call to->fetchCol()would subsequently fatal error.The
-1patch is a straight conversion. The-1-aimproves the test so it doesn't fatal error if the query returns NULL. If the-1-apatch passes all tests, that one should be preferred. If it fails, then just go with the -1.inter-interdiff.txtshows the differences between two patches.Comment #2
mparker17Comment #3
mparker17Comment #5
mparker17Try these.
The
-5versus-5-ais the same as above.Since I made the same change to both
-5and-5-a, the interdiff between-1versus-5and-1-aversus-5-ais the same, I've included only one interdiff.Comment #6
dawehnerAll this db_select calls could be replaced directly by an injected db connection, so for example extending ControllerBase would just work.
Comment #7
dawehnerAll this db_select calls could be replaced directly by an injected db connection, so for example extending ControllerBase would just work.
Comment #8
sushylComment #9
xjmThanks for your work on this issue! Please see #1971384-43: [META] Convert page callbacks to controllers for an update on the routing system conversion process.
Comment #10
sushylUnassigned, Couldn't spare enough time to look into it.
Comment #11
chakrapani commentedThere has been some changes to the core and some of the changes from the earlier patches have been already committed(eg: removal of hook_menu).
Re-rolling the patch against latest head based on #5-a.patch.
comments from #6/#7 are not considered yet in the current patch.
The patch passed the tests when run locally.
Comment #12
xjm11: system-module.2066557-11-a.patch queued for re-testing.
Comment #14
xjmComment #15
mparker17Straight re-roll of #11.
I got a merge conflict...
... so I resolved it with
git rm core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.phpNote the patch name has changed since #11 to whatever Dreditor recommended today.
Comment #16
mparker17Comment #18
berdirThe reason it did conflict is that the other class moved to src/, and this has not yet been updated for that.
Comment #19
mparker17Comment #20
mile23Comment #21
valthebaldComment #22
valthebaldComment #23
valthebaldLast patch just moves functions to Drupal\database_test\Controller\DatabaseTestController
Comment #24
mile23Thanks, @valthebald!
Just some coding standards stuff:
Needs a blank line between
namespaceanduse.All of these should be fully qualified like:
@return \Symfony\Component\HttpFoundation\JsonResponseComment #25
valthebaldHere we go
Comment #26
mile23Super awesome. :-)
Comment #27
alexpottCommitted ed7f9d9 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Need to have a leading slash - fixed on commit.