Skip to content

Commit

Permalink
Failing tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rogyar committed Jul 5, 2018
1 parent 31df140 commit 25d49eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ public function testExecute()
$creditmemoId = 2;
$date = '2015-01-19_13-03-45';
$fileName = 'creditmemo2015-01-19_13-03-45.pdf';
$fileContents = 'pdf0123456789';
$pdfContent = 'pdf0123456789';
$fileData = ['type' => 'string', 'value' => $pdfContent, 'rm' => true];
$this->prepareTestExecute($creditmemoId);

$this->objectManagerMock->expects($this->any())
Expand Down Expand Up @@ -184,12 +185,12 @@ public function testExecute()
->willReturn($date);
$this->pdfMock->expects($this->once())
->method('render')
->willReturn($fileContents);
->willReturn($pdfContent);
$this->fileFactoryMock->expects($this->once())
->method('create')
->with(
$fileName,
$fileContents,
$fileData,
\Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR,
'application/pdf'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
declare(strict_types=1);

namespace Magento\Framework\App\Filesystem\Images;
namespace Magento\Framework\App\Filesystem;

use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\Response\Http\FileFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ public function create(
* Returns file content for writing.
*
* @param string|array $content
* @return string
* @return string|array
*/
private function getFileContent($content): string
private function getFileContent($content)
{
if (isset($content['type']) && $content['type'] === 'string') {
return $content['value'];
Expand Down

0 comments on commit 25d49eb

Please sign in to comment.