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
26 lines
718 B
PHP
26 lines
718 B
PHP
<?php
|
|
|
|
use MailPoet\Models\ModelValidator;
|
|
|
|
class ModelValidatorTest extends MailPoetTest {
|
|
public $validator;
|
|
|
|
function __construct() {
|
|
parent::__construct();
|
|
$this->validator = new ModelValidator();
|
|
}
|
|
|
|
function testItConfiguresValidators() {
|
|
$configured_validators = $this->validator->getValidators();
|
|
foreach(array_keys($this->validator->validators) as $validator) {
|
|
expect($configured_validators)->contains($validator);
|
|
}
|
|
}
|
|
|
|
function testItValidatesEmail() {
|
|
expect($this->validator->validateEmail('test'))->false();
|
|
expect($this->validator->validateEmail('tést@éxample.com'))->false();
|
|
expect($this->validator->validateEmail('test@example.com'))->true();
|
|
}
|
|
}
|