Apply rules to tests and tasks

This commit is contained in:
Mike Jolley
2024-03-18 13:44:47 +00:00
committed by Jan Jakeš
parent 435f638011
commit 0d6fe6e5eb
87 changed files with 399 additions and 254 deletions

View File

@@ -171,11 +171,12 @@ class WorkerTest extends \MailPoetTest {
public function testAddsSubjectToContext() {
$this->renderer->expects($this->exactly(2)) // html + text template
->method('render')
->with(
$this->anything(),
$this->callback(function($context){
->with(
$this->anything(),
$this->callback(function($context){
return $context['subject'] === 'Rendered Email Subject';
}));
})
);
$this->statsNotifications->process();
}
@@ -184,10 +185,11 @@ class WorkerTest extends \MailPoetTest {
$this->renderer->expects($this->exactly(2)) // html + text template
->method('render')
->with(
$this->anything(),
$this->callback(function($context){
return $context['preheader'] === '60.00% clicks, 40.00% opens, 20.00% unsubscribes in a nutshell.';
}));
$this->anything(),
$this->callback(function($context){
return $context['preheader'] === '60.00% clicks, 40.00% opens, 20.00% unsubscribes in a nutshell.';
})
);
$this->statsNotifications->process();
}
@@ -200,7 +202,8 @@ class WorkerTest extends \MailPoetTest {
$this->callback(function($context){
return strpos($context['linkSettings'], 'mailpoet-settings')
&& strpos($context['linkStats'], 'mailpoet-newsletters&stats');
}));
})
);
$this->statsNotifications->process();
}
@@ -213,7 +216,8 @@ class WorkerTest extends \MailPoetTest {
$this->callback(function($context){
return ($context['topLink'] === 'Link url2')
&& ($context['topLinkClicks'] === 2);
}));
})
);
$this->statsNotifications->process();
}
@@ -239,7 +243,8 @@ class WorkerTest extends \MailPoetTest {
$this->anything(),
$this->callback(function($context){
return ($context['topLink'] === 'Manage subscription link');
}));
})
);
$this->statsNotifications->process();
}