silverstripe/recipe-blog

Get the unit test suite working

Closed this issue · 8 comments

Currently the unit test suite isn't passing. The modules pass in isolation.

Some of the errors I've noticed so far are:

  • CommentNotifier extension doesn't check if $parent has the CommentNotifiable extension before it calls it in ::onAfterPostComment
  • Comment tests are using stubs from framework that are excluded since it's installed from dist. We should use our own stubs instead
  • Perhaps missing a theme for functional tests
  • GridField bulk editing tools isn't a vendor module yet, but the PHPUnit test suite references it as one

See https://travis-ci.org/silverstripe/recipe-blog/jobs/344606949

Hmm, despite phpunit not being flooded with errors anymore, I'll let TravisCI be the judge of that.

That PR didn’t have any functional changes that would fix this test suite (that I’m aware of)

My attempts to run phpunit over it this afternoon were severely hampered by bulk editing tools, which isn't happening now (after adjusting composer so). But I do recall some issues with comments and rss feeds or something, which the comments module wasn't rendering when tested by itself (travis build is green there).

I've restarted the build for this recipe in any case.

Builds are now reflecting the right failures: https://travis-ci.org/silverstripe/recipe-blog/jobs/346109792

There is a single error blocking this now.
It is caused by BlogTest::testFilteredCategoriesRSS running before CommentingControllerTest::testRSS.

To reproduce: have both silverstripe/blog and silverstripe/comments installed, and test with:
vendor/bin/phpunit --filter RSS

PR at #15, needs to be merged up and have recipe versions adjusted as it goes

Fixed 🎉