Move WPHooks methods to WPFunctions

This commit is contained in:
Amine Ben hammou
2019-01-28 19:00:19 +01:00
parent d452cfcae7
commit 8b602bd947
49 changed files with 354 additions and 258 deletions

View File

@ -5,7 +5,7 @@ use Helper\WordPressHooks as WPHooksHelper;
use MailPoet\Mailer\Mailer;
use MailPoet\Mailer\Methods\ErrorMappers\SMTPMapper;
use MailPoet\Mailer\Methods\SMTP;
use MailPoet\WP\Hooks;
use MailPoet\WP\Functions as WPFunctions;
class SMTPTest extends \MailPoetTest {
function _before() {
@ -134,7 +134,7 @@ class SMTPTest extends \MailPoetTest {
function testItAppliesTransportFilter() {
$mailer = $this->mailer->buildMailer();
expect($mailer->getTransport()->getStreamOptions())->isEmpty();
Hooks::addFilter(
(new WPFunctions)->addFilter(
'mailpoet_mailer_smtp_transport_agent',
function($transport) {
$transport->setStreamOptions(
@ -162,7 +162,7 @@ class SMTPTest extends \MailPoetTest {
function testItAppliesTimeoutFilter() {
$mailer = $this->mailer->buildMailer();
expect($mailer->getTransport()->getTimeout())->equals(\MailPoet\Mailer\Methods\SMTP::SMTP_CONNECTION_TIMEOUT);
Hooks::addFilter(
(new WPFunctions)->addFilter(
'mailpoet_mailer_smtp_connection_timeout',
function() {
return 20;
@ -182,6 +182,5 @@ class SMTPTest extends \MailPoetTest {
}
function _after() {
WPHooksHelper::releaseAllHooks();
}
}