Username Password
Bookmark and Share

Writing Tests

Please try to write tests so that they follow the directory hierarchy of WebGUI's library directory.

Tests should clean-up after themselves, so that they can be run time and time again without resetting the database.  Starting in 7.7, WebGUI tests will automatically restore the settings table to its original state, so you do not have to do that.

When writing tests for a method or subroutine, use diag, or a label in the first test to say what you are testing:


ok($sku->can('getAddToCartForm'), 'getAddToCartForm: This sku has that method');

then, on subsequent tests, leave off the name of the subroutine and just put three dots '...'.  This will make the subroutine labels stand out and make it easier to figure out which tests are failing.

Just as with core code, please do not rewrite tests wholesale because of style issues.  The goal is to cover as much of WebGUI as possible and make our lives as devs easier.


Search | Most Popular | Recent Changes | Wiki Home
© 2020 Plain Black Corporation | All Rights Reserved