77
88namespace Magento \GraphQl \Catalog ;
99
10- use Magento \Catalog \Model \Indexer \Category \Product ;
11- use Magento \Catalog \Model \Indexer \Product \Category ;
12- use Magento \CatalogSearch \Model \Indexer \Fulltext as IndexerSearch ;
13- use Magento \Indexer \Model \Indexer ;
1410use Magento \Indexer \Test \Fixture \Indexer as IndexerFixture ;
1511use Magento \TestFramework \Fixture \Config ;
1612use Magento \TestFramework \Helper \Bootstrap ;
@@ -74,13 +70,15 @@ public function testProductWithCanonicalLinksMetaTagSettingsEnabled()
7470 $ this ->assertEquals ($ productSku , $ response ['products ' ]['items ' ][0 ]['sku ' ]);
7571 }
7672
77- /**
78- * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
79- * @magentoConfigFixture default_store catalog/seo/product_canonical_tag 0
80- */
73+ #[
74+ Config('catalog/seo/product_canonical_tag ' , 0 ),
75+ DataFixture(ProductFixture::class, as: 'product ' ),
76+ DataFixture(IndexerFixture::class)
77+ ]
8178 public function testProductWithCanonicalLinksMetaTagSettingsDisabled ()
8279 {
83- $ productSku = 'simple ' ;
80+ $ product = DataFixtureStorageManager::getStorage ()->get ('product ' );
81+ $ productSku = $ product ->getSku ();
8482 $ query
8583 = <<<QUERY
8684{
@@ -98,6 +96,6 @@ public function testProductWithCanonicalLinksMetaTagSettingsDisabled()
9896 $ this ->assertNull (
9997 $ response ['products ' ]['items ' ][0 ]['canonical_url ' ]
10098 );
101- $ this ->assertEquals (' simple ' , $ response ['products ' ]['items ' ][0 ]['sku ' ]);
99+ $ this ->assertEquals ($ productSku , $ response ['products ' ]['items ' ][0 ]['sku ' ]);
102100 }
103- }
101+ }
0 commit comments