コード例 #1
0
 /**
  * Execute full indexation
  *
  * @return void
  */
 public function executeFull()
 {
     $this->indexBuilder->reindexFull();
     $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]);
     //TODO: remove after fix fpc. MAGETWO-50668
     $this->getCacheManager()->clean($this->getIdentities());
 }
コード例 #2
0
 /**
  * @magentoDbIsolation enabled
  * @magentoAppIsolation enabled
  * @magentoDataFixture Magento/CatalogRule/_files/attribute.php
  * @magentoDataFixture Magento/CatalogRule/_files/rule_by_attribute.php
  * @magentoDataFixture Magento/Catalog/_files/product_simple.php
  */
 public function testReindexFull()
 {
     $this->prepareProducts();
     $this->indexerBuilder->reindexFull();
     $this->assertEquals(9.800000000000001, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->product->getId()));
     $this->assertEquals(9.800000000000001, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productSecond->getId()));
     $this->assertFalse($this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productThird->getId()));
 }
コード例 #3
0
 /**
  * @magentoDataFixture Magento/CatalogRule/_files/attribute.php
  * @magentoDataFixture Magento/Catalog/_files/product_simple.php
  */
 public function testReindexAfterRuleCreation()
 {
     $this->product->load(1)->setData('test_attribute', 'test_attribute_value')->save();
     $this->assertFalse($this->resourceRule->getRulePrice(new \DateTime(), 1, 1, 1));
     $this->saveRule();
     // apply all rules
     $this->indexBuilder->reindexFull();
     $this->assertEquals(9.800000000000001, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, 1));
 }
コード例 #4
0
ファイル: RuleProductTest.php プロジェクト: koliaGI/magento2
 /**
  * @magentoDataFixture Magento/CatalogRule/_files/attribute.php
  * @magentoDataFixture Magento/Catalog/_files/product_simple.php
  */
 public function testReindexAfterRuleCreation()
 {
     /** @var \Magento\Catalog\Model\ProductRepository $productRepository */
     $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\ProductRepository');
     $product = $productRepository->get('simple');
     $product->setData('test_attribute', 'test_attribute_value')->save();
     $this->assertFalse($this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $product->getId()));
     $this->saveRule();
     // apply all rules
     $this->indexBuilder->reindexFull();
     $this->assertEquals(9.800000000000001, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $product->getId()));
 }
コード例 #5
0
 /**
  * Execute full indexation
  *
  * @return void
  */
 public function executeFull()
 {
     $this->indexBuilder->reindexFull();
     $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]);
 }