Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Oct 2012 at 13:45 UTC
Updated:
29 Jul 2014 at 21:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Crell commentedRefiling. (The wscci component is vestigial.)
Also, RTBC. :-)
Comment #2
webchickLet's get some tests for this.
Comment #3
klausiNow with tests. Could not find a suiting test class, so I created a new ExceptionControllerTest in system module.
Comment #5
klausiTest only patch fails as expected :-)
Comment #6
Crell commentedI'm unclear how this is testing the behavior of the request. We're directly calling an internal method, on405Html, which is too deep. That's an implementation detail. Rather, we need to call the actual controller method of ExceptionController() and confirm that we get back the correct Response object.
Comment #7
klausiSure, now using the execute() method of the ExceptionController.
Comment #9
Crell commentedThis needs to be new \Exception('Test exception').
Comment #10
klausiOf course, I thought the backslashes were optional but obviously PHP requires them.
Comment #11
Crell commentedIn a namespaced file, classes sans-prefix are assumed to be in the current namespace if not "use"d. So PHP was converting "Exception" to "Drupal\system\Test\Exception, which of course doesn't exist.
Comment #12
webchickCommitted to 8.x. Will push at the end of my commit-spree.