Check data factories with PHPStan, fix discovered problems

[MAILPOET-2429]
This commit is contained in:
Jan Jakeš
2019-10-16 13:44:04 +02:00
committed by Jack Kitterhing
parent eb02627a98
commit ffc11af689
4 changed files with 11 additions and 2 deletions

View File

@@ -476,7 +476,12 @@ class RoboFile extends \Robo\Tasks {
// tests
->taskExec($task)
->rawArg('--configuration=phpstan-tests.neon')
->arg("$dir/tests/unit")
->rawArg(
implode(' ', [
"$dir/tests/DataFactories",
"$dir/tests/unit",
])
)
->dir(__DIR__ . '/tasks/phpstan')
->taskExec('cd ' . __DIR__ . ' && ./tools/vendor/composer.phar install')

View File

@@ -8,6 +8,7 @@ parameters:
- %mailpoetDir%/vendor/codeception/verify/src/Codeception/function.php
- %mailpoetDir%/vendor/codeception/verify/src/Codeception/Verify.php
autoload_directories:
- %mailpoetDir%/tests/_support
- %mailpoetDir%/tests/unit
dynamicConstantNames:
- WP_DEBUG

View File

@@ -20,6 +20,9 @@ class Newsletter {
/** @var array */
private $segments;
/** @var array */
private $queue_options;
/** @var array */
private $task_subscribers;

View File

@@ -98,7 +98,7 @@ class WooCommerceProduct {
$ids = array_map(function($id){
return ['id' => $id];
}, $ids);
return $this->update('tagIds', $id);
return $this->update('tagIds', $ids);
}
/**