File tree 3 files changed +7
-6
lines changed
app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo
dev/tests/integration/testsuite/Magento/Framework/App/Filesystem
lib/internal/Magento/Framework/App/Response/Http
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,8 @@ public function testExecute()
155
155
$ creditmemoId = 2 ;
156
156
$ date = '2015-01-19_13-03-45 ' ;
157
157
$ fileName = 'creditmemo2015-01-19_13-03-45.pdf ' ;
158
- $ fileContents = 'pdf0123456789 ' ;
158
+ $ pdfContent = 'pdf0123456789 ' ;
159
+ $ fileData = ['type ' => 'string ' , 'value ' => $ pdfContent , 'rm ' => true ];
159
160
$ this ->prepareTestExecute ($ creditmemoId );
160
161
161
162
$ this ->objectManagerMock ->expects ($ this ->any ())
@@ -184,12 +185,12 @@ public function testExecute()
184
185
->willReturn ($ date );
185
186
$ this ->pdfMock ->expects ($ this ->once ())
186
187
->method ('render ' )
187
- ->willReturn ($ fileContents );
188
+ ->willReturn ($ pdfContent );
188
189
$ this ->fileFactoryMock ->expects ($ this ->once ())
189
190
->method ('create ' )
190
191
->with (
191
192
$ fileName ,
192
- $ fileContents ,
193
+ $ fileData ,
193
194
\Magento \Framework \App \Filesystem \DirectoryList::VAR_DIR ,
194
195
'application/pdf '
195
196
)
Original file line number Diff line number Diff line change 6
6
*/
7
7
declare (strict_types=1 );
8
8
9
- namespace Magento \Framework \App \Filesystem \ Images ;
9
+ namespace Magento \Framework \App \Filesystem ;
10
10
11
11
use Magento \Framework \App \Filesystem \DirectoryList ;
12
12
use Magento \Framework \App \Response \Http \FileFactory ;
Original file line number Diff line number Diff line change @@ -109,9 +109,9 @@ public function create(
109
109
* Returns file content for writing.
110
110
*
111
111
* @param string|array $content
112
- * @return string
112
+ * @return string|array
113
113
*/
114
- private function getFileContent ($ content ): string
114
+ private function getFileContent ($ content )
115
115
{
116
116
if (isset ($ content ['type ' ]) && $ content ['type ' ] === 'string ' ) {
117
117
return $ content ['value ' ];
You can’t perform that action at this time.
0 commit comments