Fix unit tests for PHPUnit v6
Codeception from version 2.3 up comes with PHPUnit v6 which changed __construct behaviour. Our tests have to call parent __constructor in order to work. The error was: [PHPUnit\Framework\Exception] array_merge(): Argument #1 is not an array
This commit is contained in:
@@ -7,6 +7,7 @@ class DatabaseTestTest extends MailPoetTest {
|
||||
public $database;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->database = new Database();
|
||||
}
|
||||
|
||||
|
@@ -6,6 +6,7 @@ class ModelValidatorTest extends MailPoetTest {
|
||||
public $validator;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->validator = new ModelValidator();
|
||||
}
|
||||
|
||||
|
@@ -8,6 +8,7 @@ class NewsletterOptionTest extends MailPoetTest {
|
||||
public $data;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->data = array(
|
||||
'newsletter_id' => 1,
|
||||
'option_field_id' => 2,
|
||||
|
@@ -3,6 +3,7 @@ use MailPoet\Models\SubscriberCustomField;
|
||||
|
||||
class SubscriberCustomFieldTest extends MailPoetTest {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->data = array(
|
||||
array(
|
||||
'custom_field_id' => 10,
|
||||
|
@@ -3,6 +3,7 @@ use MailPoet\Newsletter\AutomatedLatestContent;
|
||||
|
||||
class AutomatedLatestContentTest extends MailPoetTest {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->alc = new AutomatedLatestContent();
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,7 @@ use MailPoet\Newsletter\Renderer\Renderer;
|
||||
|
||||
class NewsletterRendererTest extends MailPoetTest {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->newsletter = array(
|
||||
'body' => json_decode(
|
||||
file_get_contents(dirname(__FILE__) . '/RendererTestData.json'), true
|
||||
|
@@ -11,6 +11,7 @@ use MailPoet\Router\Router;
|
||||
|
||||
class ViewInBrowserTest extends MailPoetTest {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->newsletter =
|
||||
array(
|
||||
'body' => json_decode(
|
||||
|
@@ -10,6 +10,7 @@ class FrontRouterTest extends MailPoetTest {
|
||||
public $router;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->router_data = array(
|
||||
Router::NAME => '',
|
||||
'endpoint' => 'mock_endpoint',
|
||||
|
@@ -4,6 +4,7 @@ use MailPoet\Subscribers\ImportExport\Import\MailChimp;
|
||||
|
||||
class MailChimpTest extends MailPoetTest {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->api_key = getenv('WP_TEST_IMPORT_MAILCHIMP_API');
|
||||
$this->mailchimp = new MailChimp($this->api_key);
|
||||
$this->lists = explode(",", getenv('WP_TEST_IMPORT_MAILCHIMP_LISTS'));
|
||||
|
@@ -6,6 +6,7 @@ class ConflictResolverTest extends MailPoetTest {
|
||||
public $wp_filter;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->conflict_resolver = new ConflictResolver();
|
||||
$this->conflict_resolver->init();
|
||||
global $wp_filter;
|
||||
|
Reference in New Issue
Block a user