From 28cf751840087f87c8a03a1c1b3ca8ab8ef88176 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Wed, 2 Jan 2019 11:50:22 +0100 Subject: [PATCH] Add automatic email type to newsletters factory [MQ-170] --- tests/DataFactories/Newsletter.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/DataFactories/Newsletter.php b/tests/DataFactories/Newsletter.php index 12ac5d2693..bf378b1a9f 100644 --- a/tests/DataFactories/Newsletter.php +++ b/tests/DataFactories/Newsletter.php @@ -99,6 +99,20 @@ class Newsletter { return $this; } + /** + * @return Newsletter + */ + public function withWcAutomaticType($event = 'woocommerce_first_purchase') { + $this->data['type'] = 'automatic'; + $this->withOptions([ + 14 => 'woocommerce', // group + 15 => $event, + 16 => 'user', // sendTo + 19 => 'immediate', // afterTimeType + ]); + return $this; + } + /** * @param array $options *