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;
|
public $database;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->database = new Database();
|
$this->database = new Database();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@ class ModelValidatorTest extends MailPoetTest {
|
|||||||
public $validator;
|
public $validator;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->validator = new ModelValidator();
|
$this->validator = new ModelValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@ class NewsletterOptionTest extends MailPoetTest {
|
|||||||
public $data;
|
public $data;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->data = array(
|
$this->data = array(
|
||||||
'newsletter_id' => 1,
|
'newsletter_id' => 1,
|
||||||
'option_field_id' => 2,
|
'option_field_id' => 2,
|
||||||
|
@@ -3,6 +3,7 @@ use MailPoet\Models\SubscriberCustomField;
|
|||||||
|
|
||||||
class SubscriberCustomFieldTest extends MailPoetTest {
|
class SubscriberCustomFieldTest extends MailPoetTest {
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->data = array(
|
$this->data = array(
|
||||||
array(
|
array(
|
||||||
'custom_field_id' => 10,
|
'custom_field_id' => 10,
|
||||||
|
@@ -3,6 +3,7 @@ use MailPoet\Newsletter\AutomatedLatestContent;
|
|||||||
|
|
||||||
class AutomatedLatestContentTest extends MailPoetTest {
|
class AutomatedLatestContentTest extends MailPoetTest {
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->alc = new AutomatedLatestContent();
|
$this->alc = new AutomatedLatestContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@ use MailPoet\Newsletter\Renderer\Renderer;
|
|||||||
|
|
||||||
class NewsletterRendererTest extends MailPoetTest {
|
class NewsletterRendererTest extends MailPoetTest {
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->newsletter = array(
|
$this->newsletter = array(
|
||||||
'body' => json_decode(
|
'body' => json_decode(
|
||||||
file_get_contents(dirname(__FILE__) . '/RendererTestData.json'), true
|
file_get_contents(dirname(__FILE__) . '/RendererTestData.json'), true
|
||||||
|
@@ -11,6 +11,7 @@ use MailPoet\Router\Router;
|
|||||||
|
|
||||||
class ViewInBrowserTest extends MailPoetTest {
|
class ViewInBrowserTest extends MailPoetTest {
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->newsletter =
|
$this->newsletter =
|
||||||
array(
|
array(
|
||||||
'body' => json_decode(
|
'body' => json_decode(
|
||||||
|
@@ -10,6 +10,7 @@ class FrontRouterTest extends MailPoetTest {
|
|||||||
public $router;
|
public $router;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->router_data = array(
|
$this->router_data = array(
|
||||||
Router::NAME => '',
|
Router::NAME => '',
|
||||||
'endpoint' => 'mock_endpoint',
|
'endpoint' => 'mock_endpoint',
|
||||||
|
@@ -4,6 +4,7 @@ use MailPoet\Subscribers\ImportExport\Import\MailChimp;
|
|||||||
|
|
||||||
class MailChimpTest extends MailPoetTest {
|
class MailChimpTest extends MailPoetTest {
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->api_key = getenv('WP_TEST_IMPORT_MAILCHIMP_API');
|
$this->api_key = getenv('WP_TEST_IMPORT_MAILCHIMP_API');
|
||||||
$this->mailchimp = new MailChimp($this->api_key);
|
$this->mailchimp = new MailChimp($this->api_key);
|
||||||
$this->lists = explode(",", getenv('WP_TEST_IMPORT_MAILCHIMP_LISTS'));
|
$this->lists = explode(",", getenv('WP_TEST_IMPORT_MAILCHIMP_LISTS'));
|
||||||
|
@@ -6,6 +6,7 @@ class ConflictResolverTest extends MailPoetTest {
|
|||||||
public $wp_filter;
|
public $wp_filter;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
$this->conflict_resolver = new ConflictResolver();
|
$this->conflict_resolver = new ConflictResolver();
|
||||||
$this->conflict_resolver->init();
|
$this->conflict_resolver->init();
|
||||||
global $wp_filter;
|
global $wp_filter;
|
||||||
|
Reference in New Issue
Block a user