Unit testing

From StatusNet
(Redirected from Unit tests)
Jump to: navigation, search

As of StatusNet 0.9, some unit tests live in the 'tests' directory in the source tree.

Currently these mainly cover linking checks:

  • HashTagDetectionTests.php
  • URLDetectionTest.php

Requirements

  • command-line PHP environment
  • PHPUnit; quick install if you have PEAR set up:
    pear channel-discover pear.phpunit.de
    pear install phpunit/PHPUnit

Running the tests

  • phpunit URLDetectionTest.php
  • phpunit HashTagDetectionTests.php

If you get no output, check if your config.php is looking for a 'LACONICA' constant and try changing it to 'STATUSNET'.

('make test' coming soon? :D)

Tests needed

  • API communication
    • confirm XML responses are valid and format is sane
    • friends timeline
    • direct replies timeline
    • DM timeline
    • post
  • UI usage (via Selenium?):
    • login
    • logout
    • post message (ajax)
    • reply (ajax)
    • delete (ajax)
    • post message (non-ajax)
    • file attachment?
Personal tools
Namespaces
Variants
Actions
Navigation
Status.net
Toolbox