swipestripe
[ class tree: swipestripe ] [ index: swipestripe ] [ all elements ]

Class: StockLevelTest

Source Location: /tests/StockLevelTest.php

Class Overview

FunctionalTest
   |
   --StockLevelTest

Testing Product stock, updating stock levels when products added, removed and carts are deleted by scheduled tasks.


Author(s):

Version:

  • 1.0

Copyright:

  • Copyright (c) 2011, Frank Mullenger

Variables

Methods



Class Details

[line 30]
Testing Product stock, updating stock levels when products added, removed and carts are deleted by scheduled tasks.

Summary of tests: ----------------- add product to cart, stock is reduced in product without creating a new version of product remove product from cart, stock is replenished for product add product variation to cart, stock is reduced for product variation remove product variation from cart, stock is replenished for product variation stock level cannot be reduced < 0 for products and variations stock level can be reduced to = 0 for products and variations stock levels set at unlimited (-1) are unaffected by adding/removing to cart for Product and Variation add to cart form disappears when 0 stock left for products & products with variations variations out of stock are not available in add to cart form scheduled task deletes order and associated objects, replenishes stock

TODO ---- cannot add to cart when 0 stock - belt and braces, the add to cart form is hidden anyway cannot checkout when 0 stock




Tags:

author:  Frank Mullenger <frankmullenger@gmail.com>
version:  1.0
copyright:  Copyright (c) 2011, Frank Mullenger


[ Top ]


Class Variables

static $disable_themes =  true

[line 33]


Type:   mixed


[ Top ]

static $fixture_file =  'swipestripe/tests/Shop.yml'

[line 32]


Type:   mixed


[ Top ]

static $use_draft_site =  false

[line 34]


Type:   mixed


[ Top ]



Class Methods


method getFormData [line 67]

Array getFormData( String $formID)

Helper to get data from a form.



Parameters:

String   $formID  

[ Top ]

method logOut [line 57]

void logOut( )

Log current member out by clearing session



[ Top ]

method setUp [line 36]

void setUp( )



[ Top ]

method testAddProductToCartReduceStock [line 104]

void testAddProductToCartReduceStock( )

Add a product to the cart and reduce stock level of product without affecting versions of product



[ Top ]

method testAddProductVariationToCartReduceStock [line 187]

void testAddProductVariationToCartReduceStock( )

Add a product variation to the cart, reduce stock level for variation without creating

a new version for the variation




[ Top ]

method testCheckBoundsWhenReducingProductStock [line 274]

void testCheckBoundsWhenReducingProductStock( )

Stock levels cannot be reduced < 0, need to check bounds of stock level being set

Form validation now prevents quantity added greater than available stock levels e.g: If stock level = 4 try adding 6 to a cart




[ Top ]

method testCheckBoundsWhenReducingProductVariationStock [line 299]

void testCheckBoundsWhenReducingProductVariationStock( )

Stock levels cannot be reduced < 0, need to check bounds of stock level being set

Form validation now prevents quantity added greater than available stock levels e.g: If stock level = 5 try adding 6 to a cart




[ Top ]

method testOutOfStockVariationsNotAvailable [line 531]

void testOutOfStockVariationsNotAvailable( )

Test that only in stock variations are available on the add to cart form.



[ Top ]

method testProductOutOfStockNoAddForm [line 463]

void testProductOutOfStockNoAddForm( )

Check that out of stock products do not display a functioning add to cart form

the add to cart form will be present, in order to display form messages, but no quantity field or actions will be available




[ Top ]

method testProductStockLevelReducedToZero [line 326]

void testProductStockLevelReducedToZero( )

Stock levels can be reduced to exactly 0 for products



[ Top ]

method testProductUnlimitedStockUnaffected [line 376]

void testProductUnlimitedStockUnaffected( )

Add and remove product to cart with unlimited stock (-1), stock level unaffected



[ Top ]

method testProductVariationStockLevelReducedToZero [line 349]

void testProductVariationStockLevelReducedToZero( )

Stock levels can be reduced to exactly 0 for product variations



[ Top ]

method testProductVariationUnlimitedStockUnaffected [line 417]

void testProductVariationUnlimitedStockUnaffected( )

Add and remove product variation to cart with unlimited stock (-1), stock level unaffected



[ Top ]

method testProductWithVariationsOutOfStockNoAddForm [line 496]

void testProductWithVariationsOutOfStockNoAddForm( )

Check that products with all out of stock variations do not have add to cart forms that function

the forms will be present but without quantity fields and actions




[ Top ]

method testRemoveAbandonedCartsWithProductsTask [line 581]

void testRemoveAbandonedCartsWithProductsTask( )

Clean up abandoned carts, restock products in the orders that are deleted



[ Top ]

method testRemoveAbandonedCartsWithProductVariationsTask [line 621]

void testRemoveAbandonedCartsWithProductVariationsTask( )

Add a product variation to the cart, change the cart so that it is out of date

then delete it




[ Top ]

method testRemoveProductFromCartReplaceStock [line 146]

void testRemoveProductFromCartReplaceStock( )

remove a product from the cart and replenish stock levels



[ Top ]

method testRemoveProductVariationFromCartReplaceStock [line 226]

void testRemoveProductVariationFromCartReplaceStock( )

Remove variation from the cart and replenish stock levels



[ Top ]

method testStockLevels [line 91]

void testStockLevels( )

Check that stock level correct, considering an item is added to an order in the fixture.



[ Top ]


Documentation generated on Thu, 08 Mar 2012 16:47:29 +1300 by phpDocumentor 1.4.4