15 use PHPUnit_Framework_MockObject_MockObject as Mock;
32 private $arrayUtilsMock;
37 private $valueFactoryMock;
42 private $scopeConfigMock;
52 private $currencyValueMock;
59 $this->arrayUtilsMock = $this->getMockBuilder(ArrayUtils::class)
60 ->disableOriginalConstructor()
62 $this->valueFactoryMock = $this->getMockBuilder(PreparedValueFactory::class)
63 ->disableOriginalConstructor()
65 $this->valueMock = $this->getMockBuilder(Value::class)
66 ->disableOriginalConstructor()
68 $this->currencyValueMock = $this->getMockBuilder(Base::class)
69 ->disableOriginalConstructor()
70 ->setMethods([
'beforeSave',
'afterSave'])
72 $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
73 ->getMockForAbstractClass();
76 $this->arrayUtilsMock,
77 $this->valueFactoryMock,
78 $this->scopeConfigMock
86 'web' => [
'unsecure' => [
'base_url' =>
'http://magento2.local/']],
87 'currency' => [
'options' => [
'base' =>
'EUR']]
89 'websites' => [
'base' => [
'web' => [
'unsecure' => [
'base_url' =>
'http://magento3.local/']]]],
92 $this->valueMock->expects($this->exactly(2))
93 ->method(
'beforeSave');
94 $this->valueMock->expects($this->exactly(2))
95 ->method(
'afterSave');
97 $value1 = clone $this->valueMock;
98 $value2 = clone $this->valueMock;
100 $this->arrayUtilsMock->expects($this->exactly(2))
105 'web' => [
'unsecure' => [
'base_url' =>
'http://magento2.local/']],
106 'currency' => [
'options' => [
'base' =>
'EUR']]
111 'web/unsecure/base_url' =>
'http://magento2.local/',
112 'currency/options/base' =>
'EUR' 116 [
'web' => [
'unsecure' => [
'base_url' =>
'http://magento3.local/']]],
119 [
'web/unsecure/base_url' =>
'http://magento3.local/']
122 $this->scopeConfigMock->expects($this->exactly(3))
125 [
'web/unsecure/base_url',
'default',
null,
'http://magento2.local/'],
126 [
'currency/options/base',
'default',
null,
'EUR'],
127 [
'web/unsecure/base_url',
'websites',
'base',
'http://magento3.local/']
129 $this->valueFactoryMock->expects($this->exactly(3))
132 [
'web/unsecure/base_url',
'http://magento2.local/',
'default',
null, $value1],
133 [
'currency/options/base',
'EUR',
'default',
null, $this->currencyValueMock],
134 [
'web/unsecure/base_url',
'http://magento3.local/',
'websites',
'base', $value2]
137 $this->assertSame(
null, $this->model->process(
$data));