Refactor migrator to be a DI service

[MAILPOET-4061]
This commit is contained in:
John Oleksowicz
2022-01-27 12:14:37 -06:00
committed by Veljko V
parent ed28dcc6e6
commit 82a6fb8ac7
6 changed files with 20 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ use Helper\WordPressHooks as WPHooksHelper;
use MailPoet\API\JSON\Response as APIResponse;
use MailPoet\API\JSON\v1\Setup;
use MailPoet\Config\Activator;
use MailPoet\Config\Migrator;
use MailPoet\Config\Populator;
use MailPoet\Form\FormsRepository;
use MailPoet\Referrals\ReferralDetector;
@@ -40,7 +41,8 @@ class SetupTest extends \MailPoetTest {
$this->entityManager,
$this->diContainer->get(WP::class)
);
$router = new Setup($wpStub, new Activator($settings, $populator, $wpStub));
$migrator = $this->diContainer->get(Migrator::class);
$router = new Setup($wpStub, new Activator($settings, $populator, $wpStub, $migrator));
$response = $router->reset();
expect($response->status)->equals(APIResponse::STATUS_OK);