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.
Problem/Motivation
All field formatters supporting RDFa will most likely be making use of the FieldRdfaTestBase class to write tests. Given that we're in unit test, there is no default page output available to aid debugging in the test results.
Proposed resolution
Add our own debugging output for the HTML rendered by the field formatter (which includes the RDFa markup) and the RDF graph as parsed by EasyRdf.
The debug mode will be enabled with the 'debug' property on the FieldRdfaTestBase class. It could default to TRUE.
Remaining tasks
write a patch
User interface changes
none
API changes
new 'debug' property in FieldRdfaTestBase.
Comments
Comment #1
scor CreditAttribution: scor commentedComment #2
ashepherd CreditAttribution: ashepherd commentedComment #3
ashepherd CreditAttribution: ashepherd commentedComment #4
ashepherd CreditAttribution: ashepherd commentedremoved whitespace from 1st patch
Comment #5
ashepherd CreditAttribution: ashepherd commentedwrapped the debug() calls with check of $debug property
Comment #6
lokapujyaThe if statement should follow the drupal coding standards.
Comment #7
ashepherd CreditAttribution: ashepherd commentedah, thanks!
Comment #9
lokapujyaCloser. Typically, we don't have spaces inside the parenthesis.
Comment #11
ashepherd CreditAttribution: ashepherd commentedI'm a bonehead...my bad. thanks Jamie
Comment #12
ashepherd CreditAttribution: ashepherd commentedComment #13
scor CreditAttribution: scor commentedMaybe a better description message would be "TRUE if verbose debugging is enabled."
Maybe add comment saying that both the HTML and the parsed RDF are displayed in the results.
Comment #14
ashepherd CreditAttribution: ashepherd commented+1
Comment #15
scor CreditAttribution: scor commentedline should be < 80 characters. Make sure you end the sentence with a period :)
Comment #16
kay_v CreditAttribution: kay_v commentedmade suggested changes.
Comment #17
kay_v CreditAttribution: kay_v commentedstripped trailing whitespace at end of comment line :)
Comment #18
scor CreditAttribution: scor commentedLet's do this...
Comment #20
lauggh CreditAttribution: lauggh commentedre-rolled the patch to use /src instead of /lib/Drupal/rdf/
Comment #21
scor CreditAttribution: scor commentedpatch looks good now. Thanks Grace for the reroll!
Comment #22
alexpottCommitted fb01ce4 and pushed to 8.x. Thanks!