Skip to content

Commit a35599d

Browse files
committed
MAGETWO-64625: Implement API for file downloading by MA
add base64 encoding for transferring binary vector
1 parent 2ac81e8 commit a35599d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/code/Magento/Analytics/Model/LinkProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function get()
6161
UrlInterface::URL_TYPE_MEDIA
6262
) . $fileInfo->getPath()
6363
);
64-
$link->setInitializationVector($fileInfo->getInitializationVector());
64+
$link->setInitializationVector(base64_encode($fileInfo->getInitializationVector()));
6565
return $link;
6666
}
6767
}

app/code/Magento/Analytics/Test/Unit/Model/LinkProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testGet()
123123
);
124124
$this->linkInterfaceMock->expects($this->once())
125125
->method('setInitializationVector')
126-
->with($fileInitializationVector);
126+
->with(base64_encode($fileInitializationVector));
127127
$this->assertEquals($this->linkInterfaceMock, $this->linkProvider->get());
128128
}
129129

dev/tests/api-functional/testsuite/Magento/Analytics/Api/LinkProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testGetAll()
5858
];
5959
$response = $this->_webApiCall($serviceInfo);
6060
$this->assertEquals(2, count($response));
61-
$this->assertEquals($fileInfo->getInitializationVector(), $response['initialization_vector']);
61+
$this->assertEquals($fileInfo->getInitializationVector(), base64_encode($response['initialization_vector']));
6262
$this->assertEquals(
6363
$storeManager->getStore()->getBaseUrl(
6464
UrlInterface::URL_TYPE_MEDIA

0 commit comments

Comments
 (0)