The attached test runs a few tests on d6's node_teaser(). It is based on several tests in http://drupal.org/node/180425. This work is sponsored by CivicActions.

It runs 119 tests but 117 of them are run by 3 assert functions in a loop that tests edge cases of node_teaser with varying $size parameters.

CommentFileSizeAuthor
#2 node_teaser.test4.91 KBRok Žlender
#1 node_teaser.test_.txt4.82 KBBevan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bevan’s picture

FileSize
4.82 KB

Forgot the patch

Rok Žlender’s picture

FileSize
4.91 KB

Great stuff.
I made few changes to your test.

  • Added setup and teardown functions
  • in testFirstSentenceQuestion I removed asdlkfj from expected teaser var.

If there is a reason you left asdlkfj in that var please comment otherwise I'll commit this.

Bevan’s picture

'asdlkfj' was a mistake that I had done in demonstrating how unit tests work. thanks for removing it

beeradb’s picture

Status: Needs review » Reviewed & tested by the community

Looking over the test it looks sane. I ran it and everything passed. marking rtbc

Rok Žlender’s picture

Status: Reviewed & tested by the community » Fixed

Committed thanks Bevan and beeradb for review.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.