[
'base_color' => '{base_color}',
'base_text_color' => '{base_text_color}',
],
]);
$wooPreprocessor = new TransactionalEmails\ContentPreprocessor($transactionalEmails);
$preprocessor = new Preprocessor($acc, $alc, $wooPreprocessor, $couponPreProcessor);
expect($preprocessor->processBlock(new NewsletterEntity(), ['type' => 'woocommerceHeading']))->equals([[
'type' => 'container',
'orientation' => 'horizontal',
'styles' => [
'block' => ['backgroundColor' => '{base_color}'],
],
'blocks' => [
[
'type' => 'container',
'orientation' => 'vertical',
'styles' => ['block' => ['backgroundColor' => 'transparent']],
'blocks' => [
[
'type' => 'text',
'text' => Preprocessor::WC_HEADING_BEFORE . '
[mailpoet_woocommerce_heading_placeholder]
' . Preprocessor::WC_HEADING_AFTER,
],
],
],
],
]]);
}
public function testProcessWooCommerceContentBlock() {
$acc = Stub::make(AbandonedCartContent::class);
$alc = Stub::make(AutomatedLatestContentBlock::class);
$couponPreProcessor = Stub::make(CouponPreProcessor::class);
$wooPreprocessor = new TransactionalEmails\ContentPreprocessor(Stub::make(TransactionalEmails::class));
$preprocessor = new Preprocessor($acc, $alc, $wooPreprocessor, $couponPreProcessor);
expect($preprocessor->processBlock(new NewsletterEntity(), ['type' => 'woocommerceContent']))->equals([[
'type' => 'container',
'orientation' => 'horizontal',
'styles' => [
'block' => ['backgroundColor' => 'transparent'],
],
'blocks' => [
[
'type' => 'container',
'orientation' => 'vertical',
'styles' => ['block' => ['backgroundColor' => 'transparent']],
'blocks' => [
[
'type' => 'placeholder',
'placeholder' => '[mailpoet_woocommerce_content_placeholder]',
],
],
],
],
]]);
}
}