Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
routing system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Sep 2013 at 08:35 UTC
Updated:
29 Jul 2014 at 22:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
capuleto commentedComment #2
capuleto commentedComment #3
dawehnerSome people follow the phpunit tag, so you potentially get more reviews on that. Thank you for writing a unit test.
Let's document the proper namespace.
Let's order them properly ...
Let's also add a @group Drupal so you can run just all the drupal tests. In addition it would be nice to have a @see to the actual class, just for convenience.
If you name it like AccessSubscriberTest PhpStorm makes it really easy to switch between the class and the implementation. It is also sort of standard to name the testclass like that.
For the sake of autocompletion it would be great to document all these with the mocked class and the actual mock class (so for example @var \Symfony\Component\HttpKernel\GetResponseEvent|PHPUnit_Framework_MockObject_MockObject
Some single line describing what is tested here would be nice. PS: I really like that you actually split up the tests as much as possible!
Comment #4
capuleto commentedHej dawehner, thank you for your feedback.
Regarding your comments.. I really don't know what do you mean with "Let's document the proper namespace.".
I have checked other unit tests and I cannot really see the difference..
Comment #5
capuleto commentedFixed typo in file header.
Comment #6
capuleto commentedFixed coding standards.
Comment #7
capuleto commentedAdded missing newline after the second last bracket.
Comment #8
dawehnerPerfect!
Comment #9
webchickAwesome work! Thanks for the tests. One hopefully quick thing to fix:
This doc is just a restatement of what the method name is... while that's true of the method above it as well, that one's easier to parse out what it's actually doing.
Could we get a quick line of english here that explains what this test is testing? Is it something like "Tests that if access is granted, no further access checks are done"?
Comment #10
capuleto commentedComment #11
capuleto commentedRefactored test to cover changes introduced by #2048223: Add $account argument to AccessCheckInterface::access() method and use the current_user service and updated docblocks.
Comment #12
capuleto commentedComment #13
dawehnerYou don't have to check explicit that an exception is thrown. If you have an uncatched exception
phpunit will complain.
Comment #14
capuleto commentedComment #15
capuleto commentedOk.. Removed explicit check..
Comment #16
dawehnerTry to always provide an interdiff: https://drupal.org/documentation/git/interdiff
This makes it easier for other people to follow your changes.
Comment #17
capuleto commentedI'll keep that in mind and thank you for the tip.
Comment #18
dawehnerLet's git it in now.
Comment #19
xano14: 2099239-accesssubscriber-test-14.patch queued for re-testing.
Comment #20
webchickCommitted and pushed to 8.x. Thanks!