Fix namespace in integration tests

This commit also removed the redundant directory EmailEditor from integration tests directory.
[MAILPOET-6216]
This commit is contained in:
Jan Lysý
2024-09-18 19:02:57 +02:00
committed by Jan Lysý
parent 99a6541ffb
commit 8dc9c28fdf
15 changed files with 16 additions and 32 deletions

View File

@ -0,0 +1,36 @@
<?php declare(strict_types = 1);
namespace MailPoet\EmailEditor\Engine;
class EmailEditorTest extends \MailPoetTest {
/** @var EmailEditor */
private $emailEditor;
/** @var callable */
private $postRegisterCallback;
public function _before() {
parent::_before();
$this->emailEditor = $this->diContainer->get(EmailEditor::class);
$this->postRegisterCallback = function ($postTypes) {
$postTypes[] = [
'name' => 'custom_email_type',
'args' => [],
'meta' => [],
];
return $postTypes;
};
add_filter('mailpoet_email_editor_post_types', $this->postRegisterCallback);
$this->emailEditor->initialize();
}
public function testItRegistersCustomPostTypeAddedViaHook() {
$postTypes = get_post_types();
$this->assertArrayHasKey('custom_email_type', $postTypes);
}
public function _after() {
parent::_after();
remove_filter('mailpoet_email_editor_post_types', $this->postRegisterCallback);
}
}