DateApplierTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Test\Unit\Model\ResourceModel\Rule;
  7. use Magento\SalesRule\Model\ResourceModel\Rule\DateApplier;
  8. /**
  9. * Class DateApplierTest
  10. */
  11. class DateApplierTest extends \PHPUnit\Framework\TestCase
  12. {
  13. /**
  14. * @var DateApplier|\PHPUnit_Framework_MockObject_MockObject
  15. */
  16. protected $model;
  17. /**
  18. * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
  19. */
  20. protected $objectManager;
  21. /**
  22. * Setup the test
  23. */
  24. protected function setUp()
  25. {
  26. $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
  27. $this->model = $this->objectManager->getObject(DateApplier::class, []);
  28. }
  29. /**
  30. * test ApplyDate
  31. */
  32. public function testApplyDate()
  33. {
  34. $className = \Magento\Framework\DB\Select::class;
  35. /** @var \Magento\Framework\DB\Select|\PHPUnit_Framework_MockObject_MockObject $select */
  36. $select = $this->createMock($className);
  37. $select->expects($this->exactly(2))
  38. ->method('where')
  39. ->willReturnSelf();
  40. $now = date('Y-m-d');
  41. $this->model->applyDate($select, $now);
  42. }
  43. }