9 use Magento\Catalog\Test\Page\Product\CatalogProductView;
10 use Magento\Downloadable\Test\Fixture\DownloadableProduct;
11 use Magento\Mtf\Client\BrowserInterface;
42 'links_purchased_separately',
55 CatalogProductView $catalogProductView,
57 BrowserInterface $browser
59 $browser->open($_ENV[
'app_frontend_url'] .
$product->getUrlKey() .
'.html');
62 $pageOptions = $catalogProductView->getViewBlock()->getOptions(
$product);
63 $pageDownloadableLinks = $this->
preparePageData($pageOptions[
'downloadable_options'][
'downloadable_links']);
64 $error = $this->
verifyData($fixtureDownloadableLinks, $pageDownloadableLinks);
65 \PHPUnit\Framework\Assert::assertEmpty($error, $error);
76 $data = $this->
sortDataByPath($product->getDownloadableLinks(),
'downloadable/link::sort_order');
78 foreach (
$data[
'downloadable'][
'link'] as $key =>
$link) {
79 $link[
'links_purchased_separately'] =
$data[
'links_purchased_separately'];
80 $link = array_intersect_key(
$link, array_flip($this->linkField));
84 $data = array_intersect_key(
$data, array_flip($this->downloadableLinksField));
97 foreach (
$data[
'downloadable'][
'link'] as $key =>
$link) {
98 $link = array_intersect_key(
$link, array_flip($this->linkField));
101 $data = array_intersect_key(
$data, array_flip($this->downloadableLinksField));
113 return 'Link block for downloadable product on front-end is visible.';
prepareFixtureData(DownloadableProduct $product)
preparePageData(array $data)
processAssert(CatalogProductView $catalogProductView, DownloadableProduct $product, BrowserInterface $browser)