Skip to content

Commit eb0c43c

Browse files
committed
MAGE-1245 Correct magentoConfigFixtures
1 parent 9df76ff commit eb0c43c

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Test/Integration/Category/CategoryCacheTest.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Algolia\AlgoliaSearch\Test\Integration\Category;
44

5-
use Magento\Framework\App\RequestInterface;
5+
use Magento\Framework\App\Cache\Manager as CacheManager;
6+
use Magento\Framework\App\Config\ScopeConfigInterface;
67
use Magento\Framework\App\Response\Http as ResponseHttp;
78
use Magento\Framework\App\ResponseInterface;
8-
use Magento\Framework\Data\Form\FormKey;
9-
use Magento\TestFramework\Helper\Bootstrap;
9+
use Magento\Store\Model\ScopeInterface;
1010

1111
class CategoryCacheTest extends \Magento\TestFramework\TestCase\AbstractController
1212
{
@@ -25,20 +25,26 @@ public static function getCategoryProvider(): array
2525
protected function setUp(): void
2626
{
2727
parent::setUp();
28-
$this->cacheManager = $this->_objectManager->get(\Magento\Framework\App\Cache\Manager::class);
28+
$this->cacheManager = $this->_objectManager->get(CacheManager::class);
2929
}
3030

3131
/**
3232
* @dataProvider getCategoryProvider
3333
* @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
3537
* @magentoCache full_page enabled
3638
* @param int $categoryId
3739
* @param string $name
3840
* @return void
3941
*/
4042
public function testCategoryPlpMiss(int $categoryId, string $name): void
4143
{
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+
4248
$this->cacheManager->clean(['full_page']);
4349
$this->dispatch($this->url . $categoryId);
4450
$response = $this->getResponse();
@@ -70,7 +76,9 @@ protected function resetResponse(): void
7076
*
7177
* @dataProvider getCategoryProvider
7278
* @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
7482
* @magentoCache full_page enabled
7583
* @param int $categoryId
7684
* @param string $name

0 commit comments

Comments
 (0)