public function testSkipPostCompile(): void
{ $context = Context::
createDefaultContext();
$context->
addState(PluginLifecycleService::STATE_SKIP_ASSET_BUILDING
);
$activateContextMock =
$this->
createMock(ActivateContext::
class);
$activateContextMock->
expects(static::
once())->
method('getContext'
)->
willReturn($context);
$eventMock =
$this->
createMock(PluginPostActivateEvent::
class);
$eventMock->
expects(static::
once())->
method('getContext'
)->
willReturn($activateContextMock);
$eventMock->
expects(static::
never())->
method('getPlugin'
);
$this->pluginSubscriber->
pluginPostActivate($eventMock);
} public function testPluginPostActivate(): void
{ $pluginMock =
new PluginEntity();
$pluginMock->
setPath(''
);
$pluginMock->
setBaseClass(FakePlugin::
class);
$eventMock =
$this->
createMock(PluginPostActivateEvent::
class);
$eventMock->
expects(static::
exactly(2
))->
method('getPlugin'
)->
willReturn($pluginMock);
$this->pluginSubscriber->
pluginPostActivate($eventMock);
}