* set path for WP install on unit tests to ensure latest is always installed.

* fix tests using deprecated method
This commit is contained in:
Darren Ethier 2020-08-12 10:54:02 -04:00 committed by GitHub
parent 39270f5657
commit 3078b97534
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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' );