Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractAssertWishlistProductDetails.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Fixture\FixtureFactory;
10 use Magento\Mtf\Fixture\InjectableFixture;
11 use Magento\Wishlist\Test\Page\WishlistIndex;
13 
18 {
22  protected $skippedFields = ['sku'];
23 
32  protected function assertProductDetails(
33  WishlistIndex $wishlistIndex,
34  InjectableFixture $product,
35  FixtureFactory $fixtureFactory
36  ) {
37  $productBlock = $wishlistIndex->getWishlistBlock()->getProductItemsBlock();
38  $actualOptions = $productBlock->getItemProduct($product)->getOptions();
39  $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]);
40  $expectedOptions = $cartFixture->getItems()[0]->getData()['options'];
41 
42  $errors = $this->verifyData(
43  $this->sortDataByPath($expectedOptions, '::title'),
44  $this->sortDataByPath($actualOptions, '::title')
45  );
46  \PHPUnit\Framework\Assert::assertEmpty($errors, $errors);
47  }
48 }
verifyData(array $fixtureData, array $formData, $isStrict=false, $isPrepareError=true)
assertProductDetails(WishlistIndex $wishlistIndex, InjectableFixture $product, FixtureFactory $fixtureFactory)
$errors
Definition: overview.phtml:9