@@ -81,7 +81,7 @@ protected function setUp()
8181 public function testGetChildHtml ()
8282 {
8383 $ customerId = 1 ;
84-
84+ $ outputString = ' OutputString ' ;
8585 /** @var \Magento\Framework\View\Element\BlockInterface|\PHPUnit_Framework_MockObject_MockObject $block */
8686 $ block = $ this ->getMockBuilder (\Magento \Framework \View \Element \BlockInterface::class)
8787 ->setMethods (['setCollection ' ])
@@ -93,7 +93,7 @@ public function testGetChildHtml()
9393 /** @var \PHPUnit_Framework_MockObject_MockObject */
9494 $ addressCollection = $ this ->getMockBuilder (\Magento \Customer \Model \ResourceModel \Address \Collection::class)
9595 ->disableOriginalConstructor ()
96- ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' ])
96+ ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' , ' addFieldToFilter ' ])
9797 ->getMock ();
9898
9999 $ layout ->expects ($ this ->atLeastOnce ())->method ('getChildName ' )->with ('NameInLayout ' , 'pager ' )
@@ -108,12 +108,13 @@ public function testGetChildHtml()
108108 ->willReturnSelf ();
109109 $ addressCollection ->expects ($ this ->atLeastOnce ())->method ('setCustomerFilter ' )->with ([$ customerId ])
110110 ->willReturnSelf ();
111+ $ addressCollection ->expects (static ::any ())->method ('addFieldToFilter ' )->willReturnSelf ();
111112 $ this ->addressCollectionFactory ->expects ($ this ->atLeastOnce ())->method ('create ' )
112113 ->willReturn ($ addressCollection );
113114 $ block ->expects ($ this ->atLeastOnce ())->method ('setCollection ' )->with ($ addressCollection )->willReturnSelf ();
114115 $ this ->gridBlock ->setNameInLayout ('NameInLayout ' );
115116 $ this ->gridBlock ->setLayout ($ layout );
116- $ this ->assertEquals (' OutputString ' , $ this ->gridBlock ->getChildHtml ('pager ' ));
117+ $ this ->assertEquals ($ outputString , $ this ->gridBlock ->getChildHtml ('pager ' ));
117118 }
118119
119120 /**
@@ -137,7 +138,7 @@ public function testGetAdditionalAddresses()
137138 /** @var \PHPUnit_Framework_MockObject_MockObject */
138139 $ addressCollection = $ this ->getMockBuilder (\Magento \Customer \Model \ResourceModel \Address \Collection::class)
139140 ->disableOriginalConstructor ()
140- ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' , 'getIterator ' ])
141+ ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' , 'getIterator ' , ' addFieldToFilter ' ])
141142 ->getMock ();
142143 $ addressDataModel = $ this ->getMockForAbstractClass (\Magento \Customer \Api \Data \AddressInterface::class);
143144 $ address = $ this ->getMockBuilder (\Magento \Customer \Model \Address::class)
@@ -157,6 +158,7 @@ public function testGetAdditionalAddresses()
157158 ->willReturnSelf ();
158159 $ addressCollection ->expects ($ this ->atLeastOnce ())->method ('setCustomerFilter ' )->with ([$ customerId ])
159160 ->willReturnSelf ();
161+ $ addressCollection ->expects (static ::any ())->method ('addFieldToFilter ' )->willReturnSelf ();
160162 $ addressCollection ->expects ($ this ->atLeastOnce ())->method ('getIterator ' )
161163 ->willReturn (new \ArrayIterator ($ collection ));
162164 $ this ->addressCollectionFactory ->expects ($ this ->atLeastOnce ())->method ('create ' )
0 commit comments