Fix dependencies in tests
[MAILPOET-4372]
This commit is contained in:
@@ -100,7 +100,7 @@ class AbandonedCartTest extends \MailPoetTest {
|
||||
$this->wp = $wp;
|
||||
WPFunctions::set($this->wp);
|
||||
|
||||
$this->automaticEmailScheduler = new AutomaticEmailScheduler(new Scheduler($this->wp, $this->diContainer->get(NewslettersRepository::class)));
|
||||
$this->automaticEmailScheduler = $this->getServiceWithOverrides(AutomaticEmailScheduler::class, ['wp' => $this->wp]);
|
||||
|
||||
$this->wooCommerceCartMock = $this->mockWooCommerceClass(WC_Cart::class, ['is_empty', 'get_cart']);
|
||||
$this->cartBackup = $this->wooCommerce->cart;
|
||||
@@ -275,7 +275,7 @@ class AbandonedCartTest extends \MailPoetTest {
|
||||
$this->assertInstanceOf(ScheduledTaskEntity::class, $scheduled);
|
||||
$this->assertEquals($scheduled->getScheduledAt(), $expectedTime);
|
||||
}
|
||||
|
||||
|
||||
public function testItPostponesEmailWhenSubscriberIsActiveOnSite() {
|
||||
$newsletter = $this->createNewsletter();
|
||||
$subscriber = $this->createSubscriberAsCurrentUser();
|
||||
|
@@ -178,7 +178,7 @@ class AutomaticEmailTest extends \MailPoetTest {
|
||||
$wpMock->expects($this->any())
|
||||
->method('currentTime')
|
||||
->willReturn($currentTime->getTimestamp());
|
||||
$automaticEmailScheduler = new AutomaticEmailScheduler(new Scheduler($wpMock, $this->diContainer->get(NewslettersRepository::class)));
|
||||
$automaticEmailScheduler = $this->getServiceWithOverrides(AutomaticEmailScheduler::class, ['wp' => $wpMock]);
|
||||
// email should only be scheduled if it matches condition ("send to segment")
|
||||
$automaticEmailScheduler->scheduleAutomaticEmail('some_group', 'some_event', $condition);
|
||||
$result = $this->sendingQueuesRepository->findAll();
|
||||
|
Reference in New Issue
Block a user