@@ -51,8 +51,8 @@ protected function setUp()
5151 ->disableOriginalConstructor ()
5252 ->getMock ();
5353 $ errorMock = $ this ->getMockBuilder (Error::class)->disableOriginalConstructor ()->getMock ();
54- $ errorMock ->expects ( $ this -> any ())-> method ('getErrorMessage ' )->willReturn ('error message ' );
55- $ this ->errorFactory ->expects ( $ this -> any ())-> method ('create ' )->willReturn ($ errorMock );
54+ $ errorMock ->method ('getErrorMessage ' )->willReturn ('error message ' );
55+ $ this ->errorFactory ->method ('create ' )->willReturn ($ errorMock );
5656
5757 $ this ->result = new PackageResult ($ this ->storeManager , $ this ->errorFactory );
5858 }
@@ -78,10 +78,9 @@ public function testComposing(): void
7878 ->setMethods (['getMethod ' , 'getPrice ' , 'setPrice ' ])
7979 ->getMock ();
8080 $ price1 = 3 ;
81- $ rate1 ->expects ($ this ->any ())->method ('getMethod ' )->willReturn ('method ' );
82- $ rate1 ->expects ($ this ->any ())->method ('getPrice ' )->willReturnReference ($ price1 );
83- $ rate1 ->expects ($ this ->any ())
84- ->method ('setPrice ' )
81+ $ rate1 ->method ('getMethod ' )->willReturn ('method ' );
82+ $ rate1 ->method ('getPrice ' )->willReturnReference ($ price1 );
83+ $ rate1 ->method ('setPrice ' )
8584 ->willReturnCallback (
8685 function ($ price ) use (&$ price1 ) {
8786 $ price1 = $ price ;
@@ -91,7 +90,7 @@ function ($price) use (&$price1) {
9190 $ result1 = $ this ->getMockBuilder (Result::class)
9291 ->disableOriginalConstructor ()
9392 ->getMock ();
94- $ result1 ->expects ( $ this -> any ())-> method ('getAllRates ' )->willReturn ([$ rate1 ]);
93+ $ result1 ->method ('getAllRates ' )->willReturn ([$ rate1 ]);
9594 $ result1 ->expects ($ this ->once ())
9695 ->method ('updateRatePrice ' )
9796 ->with (2 )
@@ -106,18 +105,17 @@ function () use (&$price1) {
106105 ->setMethods (['getMethod ' , 'getPrice ' , 'setPrice ' ])
107106 ->getMock ();
108107 $ price2 = 4 ;
109- $ rate2 ->expects ($ this ->any ())->method ('getMethod ' )->willReturn ('method ' );
110- $ rate2 ->expects ($ this ->any ())->method ('getPrice ' )->willReturnReference ($ price2 );
111- $ rate2 ->expects ($ this ->any ())
112- ->method ('setPrice ' )
108+ $ rate2 ->method ('getMethod ' )->willReturn ('method ' );
109+ $ rate2 ->method ('getPrice ' )->willReturnReference ($ price2 );
110+ $ rate2 ->method ('setPrice ' )
113111 ->willReturnCallback (
114112 function ($ price ) use (&$ price2 ) {
115113 $ price2 = $ price ;
116114 }
117115 );
118116 /** @var Result|MockObject $result2 */
119117 $ result2 = $ this ->getMockBuilder (Result::class)->disableOriginalConstructor ()->getMock ();
120- $ result2 ->expects ( $ this -> any ())-> method ('getAllRates ' )->willReturn ([$ rate2 ]);
118+ $ result2 ->method ('getAllRates ' )->willReturn ([$ rate2 ]);
121119 $ result2 ->expects ($ this ->once ())
122120 ->method ('updateRatePrice ' )
123121 ->with (3 )
@@ -147,10 +145,9 @@ public function testAppendSameReference(): void
147145 ->setMethods (['getMethod ' , 'getPrice ' , 'setPrice ' ])
148146 ->getMock ();
149147 $ price1 = 3 ;
150- $ rate1 ->expects ($ this ->any ())->method ('getMethod ' )->willReturn ('method ' );
151- $ rate1 ->expects ($ this ->any ())->method ('getPrice ' )->willReturnReference ($ price1 );
152- $ rate1 ->expects ($ this ->any ())
153- ->method ('setPrice ' )
148+ $ rate1 ->method ('getMethod ' )->willReturn ('method ' );
149+ $ rate1 ->method ('getPrice ' )->willReturnReference ($ price1 );
150+ $ rate1 ->method ('setPrice ' )
154151 ->willReturnCallback (
155152 function ($ price ) use (&$ price1 ) {
156153 $ price1 = $ price ;
@@ -160,7 +157,7 @@ function ($price) use (&$price1) {
160157 $ result1 = $ this ->getMockBuilder (Result::class)
161158 ->disableOriginalConstructor ()
162159 ->getMock ();
163- $ result1 ->expects ( $ this -> any ())-> method ('getAllRates ' )->willReturn ([$ rate1 ]);
160+ $ result1 ->method ('getAllRates ' )->willReturn ([$ rate1 ]);
164161
165162 $ this ->result ->appendPackageResult ($ result1 , 1 );
166163 $ this ->result ->appendPackageResult ($ result1 , 2 );
0 commit comments