@@ -22,7 +22,42 @@ public function testGetIdentities()
22
22
$ simple10Product = $ productRepository ->get ('simple_10 ' );
23
23
$ simple20Product = $ productRepository ->get ('simple_20 ' );
24
24
25
- $ this ->assertEmpty (array_diff ($ confProduct ->getIdentities (), $ simple10Product ->getIdentities ()));
26
- $ this ->assertEmpty (array_diff ($ confProduct ->getIdentities (), $ simple20Product ->getIdentities ()));
25
+ $ this ->assertNotEmpty (array_diff ($ confProduct ->getIdentities (), $ simple10Product ->getIdentities ()));
26
+ $ this ->assertNotEmpty (array_diff ($ confProduct ->getIdentities (), $ simple20Product ->getIdentities ()));
27
+ }
28
+
29
+ /**
30
+ * Check that no children identities are added to the parent product in frontend area
31
+ *
32
+ * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
33
+ * @magentoAppArea frontend
34
+ * @return void
35
+ */
36
+ public function testGetIdentitiesForConfigurableProductOnStorefront (): void
37
+ {
38
+ $ productRepository = Bootstrap::getObjectManager ()->get (ProductRepositoryInterface::class);
39
+ $ configurableProduct = $ productRepository ->get ('configurable ' );
40
+ $ expectedIdentities = [
41
+ 'cat_p_ ' . $ configurableProduct ->getId (),
42
+ 'cat_p '
43
+ ];
44
+ $ this ->assertEquals ($ expectedIdentities , $ configurableProduct ->getIdentities ());
45
+ }
46
+
47
+ /**
48
+ * Check that no children identities are added to the parent product in frontend area
49
+ *
50
+ * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
51
+ * @magentoAppArea adminhtml
52
+ * @return void
53
+ */
54
+ public function testGetIdentitiesForConfigurableProductInAdminArea (): void
55
+ {
56
+ $ productRepository = Bootstrap::getObjectManager ()->get (ProductRepositoryInterface::class);
57
+ $ configurableProduct = $ productRepository ->get ('configurable ' );
58
+ $ expectedIdentities = [
59
+ 'cat_p_ ' . $ configurableProduct ->getId (),
60
+ ];
61
+ $ this ->assertEquals ($ expectedIdentities , $ configurableProduct ->getIdentities ());
27
62
}
28
63
}
0 commit comments