9 use Magento\Catalog\Test\Page\Product\CatalogProductView;
10 use Magento\Downloadable\Test\Fixture\DownloadableProduct;
11 use Magento\Mtf\Client\BrowserInterface;
49 CatalogProductView $productView,
51 BrowserInterface $browser
53 $browser->open($_ENV[
'app_frontend_url'] .
$product->getUrlKey() .
'.html');
56 $pageOptions = $productView->getViewBlock()->getOptions(
$product);
57 $pageSampleLinks = isset($pageOptions[
'downloadable_options'][
'downloadable_sample'])
58 ? $this->
preparePageData($pageOptions[
'downloadable_options'][
'downloadable_sample'])
60 $error = $this->
verifyData($fixtureSampleLinks, $pageSampleLinks);
61 \PHPUnit\Framework\Assert::assertEmpty($error, $error);
72 $data = $this->
sortDataByPath($product->getDownloadableSample(),
'downloadable/sample::sort_order');
74 foreach (
$data[
'downloadable'][
'sample'] as $key =>
$link) {
75 $link = array_intersect_key(
$link, array_flip($this->linkField));
78 $data = array_intersect_key(
$data, array_flip($this->downloadableSampleField));
91 foreach (
$data[
'downloadable'][
'sample'] as $key =>
$link) {
92 $link = array_intersect_key(
$link, array_flip($this->linkField));
95 $data = array_intersect_key(
$data, array_flip($this->downloadableSampleField));
107 return 'Sample block for downloadable product on front-end is visible.';
prepareFixtureData(DownloadableProduct $product)
processAssert(CatalogProductView $productView, DownloadableProduct $product, BrowserInterface $browser)
preparePageData(array $data)