Skip to content

Commit a3d2f1c

Browse files
committed
MAGETWO-39528: Implement full text search for Sales module
1 parent 82deec9 commit a3d2f1c

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

lib/internal/Magento/Framework/App/Test/Unit/Response/Http/FileFactoryTest.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -199,33 +199,25 @@ public function testCreateStringContent()
199199
$this->responseMock->expects($this->once())
200200
->method('setHttpResponseCode')
201201
->with(200)
202-
->will($this->returnSelf());
203-
$this->responseMock->expects($this->once())
204-
->method('clearBody')
205-
->will($this->returnSelf());
202+
->will($this->returnSelf());;
206203
$this->responseMock->expects($this->once())
207-
->method('setBody')
208-
->will($this->returnSelf());
209-
$this->responseMock->expects($this->never())
210204
->method('sendHeaders')
211205
->will($this->returnSelf());
206+
$this->dirMock->expects($this->once())
207+
->method('writeFile')
208+
->with('fileName', 'content', 'w+');
212209

213210
$streamMock = $this->getMockBuilder('Magento\Framework\Filesystem\File\WriteInterface')
214211
->disableOriginalConstructor()->getMock();
215-
$this->dirMock->expects($this->never())
212+
$this->dirMock->expects($this->once())
216213
->method('openFile')
217214
->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())
222216
->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())
227219
->method('close');
228-
$this->assertSame($this->responseMock, $this->getModel()->create('fileName', 'content'));
220+
$this->getModelMock()->create('fileName', 'content');
229221
}
230222

231223
/**

0 commit comments

Comments
 (0)