ProductTest.php 994 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\ConfigurableProduct\Model;
  8. use Magento\TestFramework\Helper\Bootstrap;
  9. use Magento\Catalog\Api\ProductRepositoryInterface;
  10. class ProductTest extends \PHPUnit\Framework\TestCase
  11. {
  12. /**
  13. * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
  14. */
  15. public function testGetIdentities()
  16. {
  17. $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
  18. $confProduct = $productRepository->get('configurable');
  19. $simple10Product = $productRepository->get('simple_10');
  20. $simple20Product = $productRepository->get('simple_20');
  21. $this->assertEmpty(array_diff($confProduct->getIdentities(), $simple10Product->getIdentities()));
  22. $this->assertEmpty(array_diff($confProduct->getIdentities(), $simple20Product->getIdentities()));
  23. }
  24. }