plainblack.com
Username Password
search
Bookmark and Share
Subscribe

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:

diag("getAddToCartForm");

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.

Keywords:

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