Fix phpunit test config (https://github.com/woocommerce/woocommerce-blocks/pull/3001)
* set path for WP install on unit tests to ensure latest is always installed. * fix tests using deprecated method
This commit is contained in:
parent
39270f5657
commit
3078b97534
|
@ -8,7 +8,7 @@ RUN apt-get update && \
|
|||
CMD echo "Installing tests..."
|
||||
|
||||
ENV WP_TESTS_DIR=/tmp/wordpress-tests-lib
|
||||
ENV WP_CORE_DIR=/usr/src/wordpress
|
||||
ENV WP_CORE_DIR=/tmp/src/wordpress
|
||||
|
||||
COPY install-wp-tests.sh /usr/local/bin/dockerInit
|
||||
RUN chmod +x /usr/local/bin/dockerInit
|
||||
|
|
|
@ -25,8 +25,8 @@ class ReserveStockTests extends TestCase {
|
|||
|
||||
$product = ProductHelper::create_simple_product();
|
||||
$product->set_manage_stock( true );
|
||||
$product->set_stock( 10 );
|
||||
$product->save();
|
||||
// this also saves product
|
||||
wc_update_product_stock( $product, 10 );
|
||||
|
||||
$order = OrderHelper::create_order( 1, $product ); // Note this adds 4 to the order.
|
||||
$order->set_status( 'checkout-draft' );
|
||||
|
@ -54,8 +54,8 @@ class ReserveStockTests extends TestCase {
|
|||
|
||||
$product = ProductHelper::create_simple_product();
|
||||
$product->set_manage_stock( true );
|
||||
$product->set_stock( 10 );
|
||||
$product->save();
|
||||
// this also saves product
|
||||
wc_update_product_stock( $product, 10 );
|
||||
|
||||
$order = OrderHelper::create_order( 1, $product ); // Note this adds 4 to the order.
|
||||
$order->set_status( 'checkout-draft' );
|
||||
|
|
Loading…
Reference in New Issue