Skip to content

Commit b015b65

Browse files
committed
fix issue #23521
1 parent 95fc06f commit b015b65

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
*/
1818
class DownloadTest extends \PHPUnit\Framework\TestCase
1919
{
20-
/** @var DownloadHelper */
20+
/** @var array Result of get_headers() function */
21+
public static $headers;
22+
23+
/** @var DownloadHelper */
2124
protected $_helper;
2225

2326
/** @var Filesystem|\PHPUnit_Framework_MockObject_MockObject */
@@ -230,6 +233,7 @@ protected function _setupUrlMocks($size = self::FILE_SIZE, $url = self::URL, $ad
230233
$this->returnValue($this->_handleMock)
231234
);
232235

236+
self::$headers = ['200 OK'];
233237
$this->_helper->setResource($url, DownloadHelper::LINK_TYPE_URL);
234238
}
235239

app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,13 @@ function mime_content_type()
2222
{
2323
return DownloadTest::$mimeContentType;
2424
}
25+
26+
/**
27+
* Override standard function
28+
*
29+
* @return array
30+
*/
31+
function get_headers()
32+
{
33+
return DownloadTest::$headers;
34+
}

0 commit comments

Comments
 (0)