Files
piratepoet/mailpoet/tests/integration/Config/PluginActivatedHookTest.php
Jan Jakes 82aeb89854 Use strict types in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00

46 lines
1.2 KiB
PHP

<?php declare(strict_types = 1);
namespace MailPoet\Config;
use Codeception\Stub;
use Codeception\Stub\Expected;
class PluginActivatedHookTest extends \MailPoetTest {
public function testItAddsANewMessageIfNetworkActivation() {
$deferredAdminNotices = Stub::makeEmpty(
'MailPoet\Config\DeferredAdminNotices',
[
'addNetworkAdminNotice' => Expected::exactly(1, function () {
}),
],
$this
);
$hook = new PluginActivatedHook($deferredAdminNotices);
$hook->action("mailpoet/mailpoet.php", true);
}
public function testItDoesntAddAMessageIfPluginNameDiffers() {
$deferredAdminNotices = Stub::makeEmpty(
'MailPoet\Config\DeferredAdminNotices',
[
'addNetworkAdminNotice' => Expected::never(),
],
$this
);
$hook = new PluginActivatedHook($deferredAdminNotices);
$hook->action("some/plugin.php", true);
}
public function testItDoesntAddAMessageIfNoNetworkActivation() {
$deferredAdminNotices = Stub::makeEmpty(
'MailPoet\Config\DeferredAdminNotices',
[
'addNetworkAdminNotice' => Expected::never(),
],
$this
);
$hook = new PluginActivatedHook($deferredAdminNotices);
$hook->action("mailpoet/mailpoet.php", false);
}
}