35 private $cacheManager;
40 private $interceptableValidator;
44 $this->interceptionConfig =
45 $this->createPartialMock(\
Magento\Framework\Interception\
Config\Config::class, [
'hasPlugins']);
46 $this->pluginList = $this->createPartialMock(
48 [
'setInterceptedClasses',
'setScopePriorityScheme',
'getPluginsConfig']
50 $this->cacheManager = $this->createMock(\
Magento\Framework\
App\Cache\Manager::class);
51 $this->interceptableValidator =
55 $this->model = new \Magento\Setup\Module\Di\Code\Generator\InterceptionConfigurationBuilder(
56 $this->interceptionConfig,
60 $this->interceptableValidator
69 $definedClasses = [
'Class1'];
70 $this->interceptionConfig->expects($this->once())
71 ->method(
'hasPlugins')
74 $this->typeReader->expects($this->any())
75 ->method(
'isConcrete')
80 $this->interceptableValidator->expects($this->any())
85 $this->cacheManager->expects($this->once())
86 ->method(
'setEnabled')
88 $this->pluginList->expects($this->once())
89 ->method(
'setInterceptedClasses')
90 ->with($definedClasses);
91 $this->pluginList->expects($this->once())
92 ->method(
'setScopePriorityScheme')
93 ->with([
'global',
'areaCode']);
94 $this->pluginList->expects($this->once())
95 ->method(
'getPluginsConfig')
96 ->willReturn([
'instance' => $plugins]);
98 $this->model->addAreaCode(
'areaCode');
99 $this->model->getInterceptionConfiguration($definedClasses);
109 [[
'plugin' => [
'instance' =>
'someinstance']]],
110 [[
'plugin' => [
'instance' =>
'someinstance'],
'plugin2' => [
'instance' =>
'someinstance']]]
getInterceptionConfigurationDataProvider()
testGetInterceptionConfiguration($plugins)