Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertNoVideoCategoryView.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
10 use Magento\Cms\Test\Page\CmsIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\Mtf\Fixture\InjectableFixture;
13 
17 class AssertNoVideoCategoryView extends AbstractConstraint
18 {
26  public function processAssert(
27  CmsIndex $cmsIndex,
28  CatalogCategoryView $catalogCategoryView,
29  InjectableFixture $product
30  ) {
31  $cmsIndex->open();
32  $cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]);
33  $src = $catalogCategoryView->getListProductBlock()->getProductItem($product)->getBaseImageSource();
34  \PHPUnit\Framework\Assert::assertTrue(
35  strpos($src, '/placeholder/') !== false,
36  'Product image is displayed on category view when it should not.'
37  );
38  }
39 
45  public function toString()
46  {
47  return 'No product images is displayed on category view.';
48  }
49 }
processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, InjectableFixture $product)