To ensure that the placement of microdata attributes isn't affected by future changes to the code, we should add tests.

Comments

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new3.16 KB

The attached patch tests microdata placement for all three field widgets.

Status: Needs review » Needs work

The last submitted patch, 1385860-01-test_microdata.patch, failed testing.

ericduran’s picture

Oh how did I miss this.

Don't pay attention to drupal.org test, it's broken :-/

Anonymous’s picture

I'm probably going to be rewriting this test based on #1554778: Refactor tests to use MicrodataPHP parsing library. I will post here when I have the updated patch.

ericduran’s picture

Ah cool, by the way all the test fivestar test on drupal.org are now fixed so you can ignore my previous comment.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new5.92 KB

Here is the microdata test.

I added the test as a separate file. It extends the base test class, but needs to enable microdata module in order to work. To do this, I had to add a little logic for reading in arguments to setUp and passing them through to parent::setUp.

EDIT: Note that the first test will fail until #1379072: Extend microdata support to "Stars (rated while viewing)" and "Select list" widgets is committed.

Status: Needs review » Needs work

The last submitted patch, 1385860-06-microdata-test.patch, failed testing.

Anonymous’s picture

Status: Needs work » Needs review

#6: 1385860-06-microdata-test.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1385860-06-microdata-test.patch, failed testing.

ericduran’s picture

I'll re-submit the test now.

ericduran’s picture

Status: Needs work » Needs review

#6: 1385860-06-microdata-test.patch queued for re-testing.

ericduran’s picture

StatusFileSize
new5.92 KB

Testbot went crazy, I'm going to try re-uploading the file.

Status: Needs review » Needs work

The last submitted patch, 1385860-06-microdata-test.patch, failed testing.

ericduran’s picture

So this is the error "Fatal error: Class 'MicrodataFieldTestCase' not found"

I'm pretty sure this is happening because fivestar doesn't depend on microdata so pifr doesn't know to download it for that test.

I've seen this come up before I believe there's a work around but I don't remember what it is.

ericduran’s picture

Ok here's more info on it. http://drupal.org/node/924090#comment-3527572

Apparently we could just make the testbot skip the test. That's about it.

Anonymous’s picture

StatusFileSize
new5.61 KB

Wow thank you for finding that issue, I didn't even realize it existed.

I would just like to try something to see if it will work... I will add the dependency line to a future patch, but I want to see if instantiating MicrodataFieldTestCase after the call to setUp will work.

Anonymous’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1385860-16-microdata-test.patch, failed testing.

ericduran’s picture

I'm curious what would happend if we have a fivestar_test.module which microdata as a dependency. I'm going to try it and see if it works that way.

Anonymous’s picture

Now that the GSOC student has started, I think I'm going to pull this integration test (and all of the contrib field formatter integration tests) into the microdata project, just so that the process is simpler and we can easily run them all at once. At the end of the summer, I might see if I can get them in to all of the relevant projects.

Eric, is that cool with you?

ericduran’s picture

Yep, cool with me :)

Anonymous’s picture

Project: Fivestar » Microdata
Version: 7.x-2.x-dev » 7.x-1.x-dev

Cool, I'll move it over to the Microdata project, then.

Anonymous’s picture

Title: Add tests for microdata output » Test microdata integration for fivestar module

Title change.

colette’s picture

StatusFileSize
new4.45 KB

I rewrote the test into the microdata module.