@@ -199,33 +199,25 @@ public function testCreateStringContent()
199
199
$ this ->responseMock ->expects ($ this ->once ())
200
200
->method ('setHttpResponseCode ' )
201
201
->with (200 )
202
- ->will ($ this ->returnSelf ());
203
- $ this ->responseMock ->expects ($ this ->once ())
204
- ->method ('clearBody ' )
205
- ->will ($ this ->returnSelf ());
202
+ ->will ($ this ->returnSelf ());;
206
203
$ this ->responseMock ->expects ($ this ->once ())
207
- ->method ('setBody ' )
208
- ->will ($ this ->returnSelf ());
209
- $ this ->responseMock ->expects ($ this ->never ())
210
204
->method ('sendHeaders ' )
211
205
->will ($ this ->returnSelf ());
206
+ $ this ->dirMock ->expects ($ this ->once ())
207
+ ->method ('writeFile ' )
208
+ ->with ('fileName ' , 'content ' , 'w+ ' );
212
209
213
210
$ streamMock = $ this ->getMockBuilder ('Magento\Framework\Filesystem\File\WriteInterface ' )
214
211
->disableOriginalConstructor ()->getMock ();
215
- $ this ->dirMock ->expects ($ this ->never ())
212
+ $ this ->dirMock ->expects ($ this ->once ())
216
213
->method ('openFile ' )
217
214
->will ($ this ->returnValue ($ streamMock ));
218
- $ this ->dirMock ->expects ($ this ->never ())
219
- ->method ('delete ' )
220
- ->will ($ this ->returnValue ($ streamMock ));
221
- $ streamMock ->expects ($ this ->never ())
215
+ $ streamMock ->expects ($ this ->once ())
222
216
->method ('eof ' )
223
- ->will ($ this ->returnValue (false ));
224
- $ streamMock ->expects ($ this ->never ())
225
- ->method ('read ' );
226
- $ streamMock ->expects ($ this ->never ())
217
+ ->will ($ this ->returnValue (true ));
218
+ $ streamMock ->expects ($ this ->once ())
227
219
->method ('close ' );
228
- $ this ->assertSame ( $ this -> responseMock , $ this -> getModel ( )->create ('fileName ' , 'content ' ) );
220
+ $ this ->getModelMock ( )->create ('fileName ' , 'content ' );
229
221
}
230
222
231
223
/**
0 commit comments