8 use \Magento\Sales\Model\Order\Email\Container\ShipmentCommentIdentity;
36 $this->scopeConfigInterfaceMock = $this->createMock(
39 $this->storeManagerMock = $this->createMock(\
Magento\Store\Model\StoreManagerInterface::class);
41 $this->storeMock = $this->createPartialMock(\
Magento\Store\Model\Store::class, [
'getStoreId',
'__wakeup']);
43 $this->storeId = 999999999999;
44 $this->storeMock->expects($this->any())
45 ->method(
'getStoreId')
46 ->will($this->returnValue($this->storeId));
53 $this->scopeConfigInterfaceMock->expects($this->once())
57 $this->equalTo(\
Magento\Store\Model\ScopeInterface::SCOPE_STORE),
58 $this->equalTo($this->storeId)
60 ->will($this->returnValue(
true));
61 $this->identity->setStore($this->storeMock);
62 $result = $this->identity->isEnabled();
68 $this->scopeConfigInterfaceMock->expects($this->once())
72 $this->equalTo(\
Magento\Store\Model\ScopeInterface::SCOPE_STORE),
73 $this->equalTo($this->storeId)
75 ->will($this->returnValue(
'test_value,test_value2'));
76 $this->identity->setStore($this->storeMock);
77 $result = $this->identity->getEmailCopyTo();
78 $this->assertEquals([
'test_value',
'test_value2'],
$result);
83 $this->scopeConfigInterfaceMock->expects($this->once())
87 $this->equalTo(\
Magento\Store\Model\ScopeInterface::SCOPE_STORE),
88 $this->equalTo($this->storeId)
90 ->will($this->returnValue(
null));
91 $this->identity->setStore($this->storeMock);
92 $result = $this->identity->getEmailCopyTo();
98 $this->scopeConfigInterfaceMock->expects($this->once())
102 $this->equalTo(\
Magento\Store\Model\ScopeInterface::SCOPE_STORE),
103 $this->equalTo($this->storeId)
105 ->will($this->returnValue(
'copy_method'));
107 $this->identity->setStore($this->storeMock);
108 $result = $this->identity->getCopyMethod();
109 $this->assertEquals(
'copy_method',
$result);
114 $this->scopeConfigInterfaceMock->expects($this->once())
118 $this->equalTo(\
Magento\Store\Model\ScopeInterface::SCOPE_STORE),
119 $this->equalTo($this->storeId)
121 ->will($this->returnValue(
'template_id'));
123 $this->identity->setStore($this->storeMock);
124 $result = $this->identity->getGuestTemplateId();
125 $this->assertEquals(
'template_id',
$result);
130 $this->scopeConfigInterfaceMock->expects($this->once())
134 $this->equalTo(\
Magento\Store\Model\ScopeInterface::SCOPE_STORE),
135 $this->equalTo($this->storeId)
137 ->will($this->returnValue(
'template_id'));
139 $this->identity->setStore($this->storeMock);
140 $result = $this->identity->getTemplateId();
141 $this->assertEquals(
'template_id',
$result);
146 $this->identity->setStore($this->storeMock);
147 $result = $this->identity->getStore();
148 $this->assertEquals($this->storeMock,
$result);
153 $this->storeManagerMock->expects($this->once())
155 ->will($this->returnValue($this->storeMock));
156 $result = $this->identity->getStore();
157 $this->assertEquals($this->storeMock,
$result);
162 $this->identity->setCustomerEmail(
'email');
163 $result = $this->identity->getCustomerEmail();
164 $this->assertEquals(
'email',
$result);
169 $this->identity->setCustomerName(
'name');
170 $result = $this->identity->getCustomerName();
171 $this->assertEquals(
'name',
$result);
177 $this->scopeConfigInterfaceMock->expects($this->once())
181 $this->equalTo(\
Magento\Store\Model\ScopeInterface::SCOPE_STORE),
182 $this->equalTo($this->storeId)
184 ->will($this->returnValue($emailIdentity));
186 $this->identity->setStore($this->storeMock);
187 $result = $this->identity->getEmailIdentity();
188 $this->assertEquals($emailIdentity,
$result);