Mock is-WooCommerce-active detection in PostContentManagerTest

[MAILPOET-2382]
This commit is contained in:
Jan Jakeš
2019-10-03 09:23:25 +02:00
committed by Jack Kitterhing
parent 91cbe84bb9
commit 50043472ee
2 changed files with 12 additions and 5 deletions

View File

@@ -13,10 +13,10 @@ class PostContentManager {
/** @var WooCommerceHelper */
private $woocommerce_helper;
function __construct() {
function __construct(WooCommerceHelper $woocommerce_helper = null) {
$wp = new WPFunctions;
$this->max_excerpt_length = $wp->applyFilters('mailpoet_newsletter_post_excerpt_length', $this->max_excerpt_length);
$this->woocommerce_helper = new WooCommerceHelper();
$this->woocommerce_helper = $woocommerce_helper ?: new WooCommerceHelper();
}
function getContent($post, $displayType) {