Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DateApplierTest.php
Go to the documentation of this file.
1 <?php
7 
9 
13 class DateApplierTest extends \PHPUnit\Framework\TestCase
14 {
18  protected $model;
19 
23  protected $objectManager;
24 
28  protected function setUp()
29  {
30  $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
31 
32  $this->model = $this->objectManager->getObject(
33  \Magento\SalesRule\Model\ResourceModel\Rule\DateApplier::class,
34  []
35  );
36  }
37 
41  public function testApplyDate()
42  {
43  $className = \Magento\Framework\DB\Select::class;
45  $select = $this->createMock($className);
46 
47  $select->expects($this->exactly(2))
48  ->method('where')
49  ->willReturnSelf();
50 
51  $now = date('Y-m-d');
52 
53  $this->model->applyDate($select, $now);
54  }
55 }
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31