Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML Sitemap Unit Tests #29

alexfinnarn opened this issue Dec 3, 2016 · 1 comment


Copy link

commented Dec 3, 2016

92 passes, 11 fails, 1 exception, and 5 debug messages

All seems to relate to Regenerate flag. I had issues with that variable before so this doesn't surprise me.


This comment has been minimized.

Copy link
Contributor Author

commented Dec 27, 2016

The last few failed tests relate to the regenerate flag during a cron run: Issue #32.

However, testSaveLink() includes a lot of failures also related to the regenerate flag not being reset. The curious thing is that if you place an assertion before the first link is saved,

function testSaveLink() { $this->assertFlag('regenerate_needed', TRUE); $link = array('type' => 'testing', 'id' => 1, 'loc' => 'testing', 'status' => 1); xmlsitemap_link_save($link); $this->assertFlag('regenerate_needed', TRUE);

the first assertion passes but the second assertion fails. Leaving the test as it was...

function testSaveLink() { $link = array('type' => 'testing', 'id' => 1, 'loc' => 'testing', 'status' => 1); xmlsitemap_link_save($link); $this->assertFlag('regenerate_needed', TRUE);

causes the assertion after the link is saved to pass. Wahht? How can asserting if a variable is set to TRUE interfere with the second assertion?

This makes me think something is screwy with accessing variables during tests runs...or the process after a link is saved takes too long for the assertion to pass...don't understand it.

The good news is that while manually testing adding a page, unpublishing, and republishing it, the sitemap is set to be regenerated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.