@@ -81,7 +81,7 @@ protected function setUp()
81
81
public function testGetChildHtml ()
82
82
{
83
83
$ customerId = 1 ;
84
-
84
+ $ outputString = ' OutputString ' ;
85
85
/** @var \Magento\Framework\View\Element\BlockInterface|\PHPUnit_Framework_MockObject_MockObject $block */
86
86
$ block = $ this ->getMockBuilder (\Magento \Framework \View \Element \BlockInterface::class)
87
87
->setMethods (['setCollection ' ])
@@ -93,7 +93,7 @@ public function testGetChildHtml()
93
93
/** @var \PHPUnit_Framework_MockObject_MockObject */
94
94
$ addressCollection = $ this ->getMockBuilder (\Magento \Customer \Model \ResourceModel \Address \Collection::class)
95
95
->disableOriginalConstructor ()
96
- ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' ])
96
+ ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' , ' addFieldToFilter ' ])
97
97
->getMock ();
98
98
99
99
$ layout ->expects ($ this ->atLeastOnce ())->method ('getChildName ' )->with ('NameInLayout ' , 'pager ' )
@@ -108,12 +108,13 @@ public function testGetChildHtml()
108
108
->willReturnSelf ();
109
109
$ addressCollection ->expects ($ this ->atLeastOnce ())->method ('setCustomerFilter ' )->with ([$ customerId ])
110
110
->willReturnSelf ();
111
+ $ addressCollection ->expects (static ::any ())->method ('addFieldToFilter ' )->willReturnSelf ();
111
112
$ this ->addressCollectionFactory ->expects ($ this ->atLeastOnce ())->method ('create ' )
112
113
->willReturn ($ addressCollection );
113
114
$ block ->expects ($ this ->atLeastOnce ())->method ('setCollection ' )->with ($ addressCollection )->willReturnSelf ();
114
115
$ this ->gridBlock ->setNameInLayout ('NameInLayout ' );
115
116
$ this ->gridBlock ->setLayout ($ layout );
116
- $ this ->assertEquals (' OutputString ' , $ this ->gridBlock ->getChildHtml ('pager ' ));
117
+ $ this ->assertEquals ($ outputString , $ this ->gridBlock ->getChildHtml ('pager ' ));
117
118
}
118
119
119
120
/**
@@ -137,7 +138,7 @@ public function testGetAdditionalAddresses()
137
138
/** @var \PHPUnit_Framework_MockObject_MockObject */
138
139
$ addressCollection = $ this ->getMockBuilder (\Magento \Customer \Model \ResourceModel \Address \Collection::class)
139
140
->disableOriginalConstructor ()
140
- ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' , 'getIterator ' ])
141
+ ->setMethods (['setOrder ' , 'setCustomerFilter ' , 'load ' , 'getIterator ' , ' addFieldToFilter ' ])
141
142
->getMock ();
142
143
$ addressDataModel = $ this ->getMockForAbstractClass (\Magento \Customer \Api \Data \AddressInterface::class);
143
144
$ address = $ this ->getMockBuilder (\Magento \Customer \Model \Address::class)
@@ -157,6 +158,7 @@ public function testGetAdditionalAddresses()
157
158
->willReturnSelf ();
158
159
$ addressCollection ->expects ($ this ->atLeastOnce ())->method ('setCustomerFilter ' )->with ([$ customerId ])
159
160
->willReturnSelf ();
161
+ $ addressCollection ->expects (static ::any ())->method ('addFieldToFilter ' )->willReturnSelf ();
160
162
$ addressCollection ->expects ($ this ->atLeastOnce ())->method ('getIterator ' )
161
163
->willReturn (new \ArrayIterator ($ collection ));
162
164
$ this ->addressCollectionFactory ->expects ($ this ->atLeastOnce ())->method ('create ' )
0 commit comments