Skip to content

Commit 25d49eb

Browse files
committed
Failing tests fixed
1 parent 31df140 commit 25d49eb

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/PrintActionTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ public function testExecute()
155155
$creditmemoId = 2;
156156
$date = '2015-01-19_13-03-45';
157157
$fileName = 'creditmemo2015-01-19_13-03-45.pdf';
158-
$fileContents = 'pdf0123456789';
158+
$pdfContent = 'pdf0123456789';
159+
$fileData = ['type' => 'string', 'value' => $pdfContent, 'rm' => true];
159160
$this->prepareTestExecute($creditmemoId);
160161

161162
$this->objectManagerMock->expects($this->any())
@@ -184,12 +185,12 @@ public function testExecute()
184185
->willReturn($date);
185186
$this->pdfMock->expects($this->once())
186187
->method('render')
187-
->willReturn($fileContents);
188+
->willReturn($pdfContent);
188189
$this->fileFactoryMock->expects($this->once())
189190
->method('create')
190191
->with(
191192
$fileName,
192-
$fileContents,
193+
$fileData,
193194
\Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR,
194195
'application/pdf'
195196
)

dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
declare(strict_types=1);
88

9-
namespace Magento\Framework\App\Filesystem\Images;
9+
namespace Magento\Framework\App\Filesystem;
1010

1111
use Magento\Framework\App\Filesystem\DirectoryList;
1212
use Magento\Framework\App\Response\Http\FileFactory;

lib/internal/Magento/Framework/App/Response/Http/FileFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ public function create(
109109
* Returns file content for writing.
110110
*
111111
* @param string|array $content
112-
* @return string
112+
* @return string|array
113113
*/
114-
private function getFileContent($content): string
114+
private function getFileContent($content)
115115
{
116116
if (isset($content['type']) && $content['type'] === 'string') {
117117
return $content['value'];

0 commit comments

Comments
 (0)