Skip to content

Commit

Permalink
Fixed deposit tests class
Browse files Browse the repository at this point in the history
  • Loading branch information
gpressutto5 committed Jan 4, 2024
1 parent 18af61d commit a9b2903
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/unit/helpers/class-wc-helper-deposit-product-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@
* This helper class should ONLY be used for unit tests!.
*/
class WC_Deposits_Product_Manager {
public static function get_deposit_type( WC_Product_Simple $product ) {
/**
* @param WC_Product_Simple|int $product
* @return mixed
*/
public static function get_deposit_type( $product ) {
if ( is_int( $product ) ) {
$product = wc_get_product( $product );
}
return $product->get_meta( '_wc_deposit_type' );
}
public static function deposits_enabled( WC_Product_Simple $product ) {

/**
* @param WC_Product_Simple|int $product
* @return bool
*/
public static function deposits_enabled( $product ) {
if ( is_int( $product ) ) {
$product = wc_get_product( $product );
}
return true === $product->get_meta( '_wc_deposits_enabled' );
}
}

0 comments on commit a9b2903

Please sign in to comment.