\SWS_ProductTest
Testing {@link Product} attributes and options on product pages.
Summary of tests:
-----------------
delete product, is unpublished, versions still exist
new version of product created when amount changed
variations disabled when new attribute added
correct options for variations returned on product page on first dropdown
cannot save negative amount for product variation
TODO
----
add new variation
add product to parent page, check URL works
add product to multiple categories, check that it appears on each
disable all variations, product should be unpublished
try saving product with 'action_publish' passed as a Get var, when no enabled variations exist product should not be published
add product to cart, stock depletes latest version of product
add variation to cart, stock depletes latest version of variation
remove product from cart, stock replenishes latest version of product
remote variation from cart, stock replenishes latest version of variation
scheduled task deletes order and associated objects, replenishes stock
- Author: Frank Mullenger <frankmullenger@gmail.com>
- Copyright: Copyright (c) 2011, Frank Mullenger
Synopsis
- // members
- protected static boolean $use_draft_site = true;
- // Inherited members from SWS_Test
- protected static string $fixture_file;
- protected static boolean $disable_themes;
- protected static boolean $use_draft_site;
- // methods
- public void setUp()
- public void testDeleteProduct()
- public void testChangeProductAmount()
- public void testVariationsRemainEnabledAfterAttributeWrite()
- public void testVariationsDisabledAfterAttributeAdded()
- public void testProductOptionsFirstSet()
- public void testNegativeVariationPrice()
- // Inherited methods from SWS_Test
- public void setUp()
- public void logOut()
- public Array getFormData()
- public Array getFormDataNested()
- public Array searchNestedArray()
- public void testSWS()
Hierarchy
Extends
Members
protected
- $disable_themes
- $fixture_file
- $use_draft_site
- $use_draft_site
Methods
public
- setUp()
- testChangeProductAmount() — Try to publish a product with amount changed
- testDeleteProduct() — Try to delete a product, make sure it is unpublished but that versions remain the same
- testNegativeVariationPrice() — Try to save a Variation with a negative price difference
- testProductOptionsFirstSet() — Load the project page and test the first select for correct product options
- testVariationsDisabledAfterAttributeAdded() — Try adding a new attribute to a product, existing variations that do not have an option set for the new attribute should be disabled
- testVariationsRemainEnabledAfterAttributeWrite() — Try writing Attribute for a product, make sure variations remain enabled
Inherited from SWS_Test
public
- getFormData() — Helper to get data from a form.
- getFormDataNested() — Helper to get data from a form in a nested array instead of just flat. Useful for post() calls.
- logOut() — Log current member out by clearing session
- searchNestedArray() — Search a nested array for key => value pair
- setUp()
- testSWS()