Check all test support files with PHPStan
[MAILPOET-2429]
This commit is contained in:
committed by
Jack Kitterhing
parent
a2982de3a8
commit
e3176a3edf
@@ -474,6 +474,7 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
->rawArg('--configuration=phpstan-tests.neon')
|
->rawArg('--configuration=phpstan-tests.neon')
|
||||||
->rawArg(
|
->rawArg(
|
||||||
implode(' ', [
|
implode(' ', [
|
||||||
|
"$dir/tests/_support",
|
||||||
"$dir/tests/DataFactories",
|
"$dir/tests/DataFactories",
|
||||||
"$dir/tests/acceptance",
|
"$dir/tests/acceptance",
|
||||||
"$dir/tests/unit",
|
"$dir/tests/unit",
|
||||||
|
@@ -8,6 +8,7 @@ parameters:
|
|||||||
- %mailpoetDir%/vendor/codeception/verify/src/Codeception/function.php
|
- %mailpoetDir%/vendor/codeception/verify/src/Codeception/function.php
|
||||||
- %mailpoetDir%/vendor/codeception/verify/src/Codeception/Verify.php
|
- %mailpoetDir%/vendor/codeception/verify/src/Codeception/Verify.php
|
||||||
autoload_directories:
|
autoload_directories:
|
||||||
|
- %mailpoetDir%/tests/_support/_generated # without this line PHPStan segfaults ¯\_(ツ)_/¯
|
||||||
- %mailpoetDir%/tests/_support
|
- %mailpoetDir%/tests/_support
|
||||||
- %mailpoetDir%/tests/acceptance
|
- %mailpoetDir%/tests/acceptance
|
||||||
- %mailpoetDir%/tests/unit
|
- %mailpoetDir%/tests/unit
|
||||||
@@ -15,6 +16,8 @@ parameters:
|
|||||||
- WP_DEBUG
|
- WP_DEBUG
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
- '/Parameter #1 $cssOrXPath of method AcceptanceTester::moveMouseOver() expects string|null, array<string, string> given./'
|
- '/Parameter #1 $cssOrXPath of method AcceptanceTester::moveMouseOver() expects string|null, array<string, string> given./'
|
||||||
|
excludes_analyse:
|
||||||
|
- %mailpoetDir%/tests/_support/_generated
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Mailpoet\Models\Form as FormModel;
|
use MailPoet\Models\Form as FormModel;
|
||||||
use MailPoet\Test\DataFactories\Form;
|
use MailPoet\Test\DataFactories\Form;
|
||||||
use MailPoet\Test\DataFactories\Segment;
|
use MailPoet\Test\DataFactories\Segment;
|
||||||
use MailPoet\Test\DataFactories\Subscriber;
|
use MailPoet\Test\DataFactories\Subscriber;
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Helper;
|
namespace Helper;
|
||||||
|
|
||||||
|
use Codeception\Module\WebDriver;
|
||||||
use Codeception\TestInterface;
|
use Codeception\TestInterface;
|
||||||
|
|
||||||
// here you can define custom actions
|
// here you can define custom actions
|
||||||
@@ -18,6 +19,7 @@ class Acceptance extends \Codeception\Module
|
|||||||
*/
|
*/
|
||||||
function seeNoJSErrors() {
|
function seeNoJSErrors() {
|
||||||
$wd = $this->getModule('WPWebDriver');
|
$wd = $this->getModule('WPWebDriver');
|
||||||
|
assert($wd instanceof WebDriver);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$logEntries = array_slice(
|
$logEntries = array_slice(
|
||||||
@@ -45,7 +47,9 @@ class Acceptance extends \Codeception\Module
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentUrl() {
|
function getCurrentUrl() {
|
||||||
return $this->getModule('WPWebDriver')->_getCurrentUri();
|
$wd = $this->getModule('WPWebDriver');
|
||||||
|
assert($wd instanceof WebDriver);
|
||||||
|
return $wd->_getCurrentUri();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isJSError($logEntry) {
|
protected function isJSError($logEntry) {
|
||||||
|
Reference in New Issue
Block a user