Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Nov 2014 at 18:10 UTC
Updated:
16 Dec 2014 at 16:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mile23The patch.
Comment #2
dawehnerLet's use $this->assertInstanceOf
Three parameters to assertSame?
Comment #3
mile231. Good catch. Done.
2. I suppose that's left over from the SimpleTest test, when a fail didn't show you the data set. Gone.
Found some formatting errors, and added a docblock for providerTestGetBestMatchingLangcode().
Also there should be a followup for this:
Comment #4
daffie commentedI did a review and it looks good, but I have few remarks:
- The UserAgentTest is RTBC for me.
- The function providerTestLoad() in the HtmlTest class has no docblock.
- Nitpick: The function testLoad() in the HtmlTest class has only two parameters. The provider gives three parameters. Can we add the third parameter. I know it is not used.
- In the HtmlTest class there are no tests for the functions getClass() and getUniqueId(). There are more untested functions. But they are tested in other functions.
I know that we have problems with how html5 code in drupal. I think it would be a good idea to add a lot of extra test cases to the data provider of the HtmlTest class. Not now but in or after #1333730: [Meta] PHP DOM (libxml2) misinterprets HTML5.
Comment #5
mile23OK, so for some reason no one moved
core/tests/Drupal/Tests/Core/Utility/HtmlTest.phpto theComponentnamespace. :-)So I'll make another issue for HtmlTest, moving it to the proper namespace and adding the code from this issue.
In this patch: UserAgentTest and nothing else. :-)
Comment #6
mile23Aw crap. Too many attached files.
Watch now as I fumble in the dark.
The latter set of patch+interdiff is the relevant one.
Patch: https://www.drupal.org/files/issues/2382011_5_0.patch
Interdiff: https://www.drupal.org/files/issues/interdiff_8307.txt
Comment #7
mile23New followup issue here: #2383945: Expand test coverage for Drupal\Component\Utility\Html
Comment #8
daffie commentedDouble post
Comment #9
daffie commentedThe UserAgentTest has been moved and refactored to a PHPUnitTest.
The old test has been deleted.
The comments are all in order.
It looks good to me so I give it a RTBC.
For the committer. The correct patch file is: 2382011_5_0.patch
@Mile23: No more working in the dark!
Comment #10
alexpottCommitted 4e90206 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation for to the issue summary.