2
2
3
3
namespace Algolia \AlgoliaSearch \Test \Integration \Category ;
4
4
5
- use Magento \Framework \App \RequestInterface ;
5
+ use Magento \Framework \App \Cache \Manager as CacheManager ;
6
+ use Magento \Framework \App \Config \ScopeConfigInterface ;
6
7
use Magento \Framework \App \Response \Http as ResponseHttp ;
7
8
use Magento \Framework \App \ResponseInterface ;
8
- use Magento \Framework \Data \Form \FormKey ;
9
- use Magento \TestFramework \Helper \Bootstrap ;
9
+ use Magento \Store \Model \ScopeInterface ;
10
10
11
11
class CategoryCacheTest extends \Magento \TestFramework \TestCase \AbstractController
12
12
{
@@ -25,20 +25,26 @@ public static function getCategoryProvider(): array
25
25
protected function setUp (): void
26
26
{
27
27
parent ::setUp ();
28
- $ this ->cacheManager = $ this ->_objectManager ->get (\ Magento \ Framework \ App \ Cache \Manager ::class);
28
+ $ this ->cacheManager = $ this ->_objectManager ->get (CacheManager ::class);
29
29
}
30
30
31
31
/**
32
32
* @dataProvider getCategoryProvider
33
33
* @depends testFullPageCacheAvailable
34
- * @magentoConfigFixture default/system/full_page_cache/caching_application 1
34
+ * @magentoConfigFixture current_store system/full_page_cache/caching_application 1
35
+ * @magentoConfigFixture current_store algoliasearch_advanced/advanced/prevent_backend_rendering 0
36
+ * @magentoConfigFixture current_store algoliasearch_instant/instant/replace_categories 1
35
37
* @magentoCache full_page enabled
36
38
* @param int $categoryId
37
39
* @param string $name
38
40
* @return void
39
41
*/
40
42
public function testCategoryPlpMiss (int $ categoryId , string $ name ): void
41
43
{
44
+ $ config = $ this ->_objectManager ->get (ScopeConfigInterface::class);
45
+ $ replace = $ config ->getValue ('algoliasearch_instant/instant/replace_categories ' , ScopeInterface::SCOPE_STORE );
46
+ $ this ->assertEquals (1 , $ replace ,"Replace categories must be enabled for this test. " );
47
+
42
48
$ this ->cacheManager ->clean (['full_page ' ]);
43
49
$ this ->dispatch ($ this ->url . $ categoryId );
44
50
$ response = $ this ->getResponse ();
@@ -70,7 +76,9 @@ protected function resetResponse(): void
70
76
*
71
77
* @dataProvider getCategoryProvider
72
78
* @depends testCategoryPlpMiss
73
- * @magentoConfigFixture default/system/full_page_cache/caching_application 1
79
+ * @magentoConfigFixture current_store system/full_page_cache/caching_application 1
80
+ * @magentoConfigFixture current_store algoliasearch_advanced/advanced/prevent_backend_rendering 0
81
+ * @magentoConfigFixture current_store algoliasearch_instant/instant/replace_categories 1
74
82
* @magentoCache full_page enabled
75
83
* @param int $categoryId
76
84
* @param string $name
0 commit comments