Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Similarly to #1867096: Rewrite RdfaMarkupTest to parse RDFa, we should also update CommentAttributesTest to use easyrdf to parse the RDFa output and verify that the output is what we expect.
This issue depends on the easyrdf library: #1866858: Test RDFa by parsing RDFa (add the easyrdf library).
Comment | File | Size | Author |
---|---|---|---|
#18 | 1886108-18-comment-test.patch | 19.7 KB | scor |
#18 | interdiff.txt | 1.98 KB | scor |
#14 | 1886108-14-comment-test.patch | 19.59 KB | scor |
#14 | interdiff.txt | 8.67 KB | scor |
#13 | 1886108-13-comment-test.patch | 19.74 KB | scor |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedHere's a start on the comment test. I have removed the rdf_test module from the requirements because this seems to be testing the default mappings, not those set in rdf_test.
EDIT: Gah, wrong patch!
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedOk, this is the one that should be tested.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedThis removes the dependency on standard profile. I've only adapted the first test in the file, so the other tests are temporarily commented out.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedActually, that one won't quite work.
Comment #8
scor CreditAttribution: scor commentedgood job Lin on removing the dependency on standard profile. I had to grant the permission 'skip comment approval' to the web_user to reflect the standard profile. Otherwise, converted all XPaths to easyrdf based tests.
Comment #9
scor CreditAttribution: scor commentedremoved a few lone $this->drupalGet() which were no longer necessary and fixed the url for parsing comment on a full node.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commented#9: 1886108-09-comment-test.patch queued for re-testing.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedThat fail seems like a testbot glitch to me.
These changes make the test much clearer, which is great.
We should look at which permissions are actually necessary for what the users currently do. I feel like some might not be required anymore.
We don't end up using the comments that are returned here, so might as well not store them.
Why is the expected value array duplicated here?
Maybe we can move the assignment of base uri and node URIs to setup?
We should probably be consistent and use saveComment across the board.
Variable isn't used.
It seems that this name variable is no longer used. It is set later, directly before it is used.
Needs documentation.
Comment #13
scor CreditAttribution: scor commentedthanks for the thorough review. this patch should address all remarks.
- remove $node2 since we can just as well use node1 to post the comment #2.
- $comment2_uri is definitely being used (6th remark).
Comment #14
scor CreditAttribution: scor commentedI actually forgot to cover the first remark of #12, and while doing that I was able to trim down the code even more! remove all our custom users and node1, which are all available via CommentTestBase.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedGreat!
I'm pretty sure the comment2_uri on line 118 is not being used.
Comment #16
scor CreditAttribution: scor commentedComment #17
Anonymous (not verified) CreditAttribution: Anonymous commentedRight, look for comment2_uri in the function above, not comment_2_uri. I only notice this because PhpStorm tells me it is so :-P
Comment #18
scor CreditAttribution: scor commentedI was looking for the wrong var :\ - in chatting on IRC, Lin and I found more unused variables, which are fixed in this patch, along with some other minor docs improvments.
Comment #19
Anonymous (not verified) CreditAttribution: Anonymous commentedLooks good to me.
This will speed up the RDF tests by removing the dependency on standard profile and will also make them more reliable since we actually parse the RDFa now.
Comment #20
webchickCommitted and pushed to 8.x. Thanks! :D