Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DailyCatalogUpdateTest.php
Go to the documentation of this file.
1 <?php
8 
10 
11 class DailyCatalogUpdateTest extends \PHPUnit\Framework\TestCase
12 {
19 
25  protected $cron;
26 
27  protected function setUp()
28  {
29  $this->ruleProductProcessor = $this->createMock(
30  \Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor::class
31  );
32 
33  $this->cron = (new ObjectManager($this))->getObject(
34  \Magento\CatalogRule\Cron\DailyCatalogUpdate::class,
35  [
36  'ruleProductProcessor' => $this->ruleProductProcessor,
37  ]
38  );
39  }
40 
41  public function testDailyCatalogUpdate()
42  {
43  $this->ruleProductProcessor->expects($this->once())->method('markIndexerAsInvalid');
44 
45  $this->cron->execute();
46  }
47 }