Skip to content

Commit 939b331

Browse files
author
m.mezhensky
committed
Unit test for Magento\Catalog\Observer\SetSpecialPriceStartDate
1 parent ce32042 commit 939b331

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app/code/Magento/Catalog/Test/Unit/Observer/SetSpecialPriceStartDateTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
namespace Magento\Catalog\Test\Unit\Observer;
1010

11+
use Magento\Catalog\Model\Product;
12+
use Magento\Catalog\Observer\SetSpecialPriceStartDate;
1113
use Magento\Framework\Event;
1214
use Magento\Framework\Event\Observer;
13-
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1415
use Magento\Framework\Stdlib\DateTime\Timezone;
15-
use Magento\Catalog\Model\Product;
16-
use Magento\Catalog\Observer\SetSpecialPriceStartDate;
17-
use PHPUnit\Framework\TestCase;
16+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1817
use PHPUnit\Framework\MockObject\MockObject;
18+
use PHPUnit\Framework\TestCase;
1919

2020
/**
2121
* Unit test for \Magento\Catalog\Observer\SetSpecialPriceStartDate
@@ -62,7 +62,7 @@ class SetSpecialPriceStartDateTest extends TestCase
6262
/**
6363
* @inheritdoc
6464
*/
65-
protected function setUp() : void
65+
protected function setUp(): void
6666
{
6767
$this->objectManager = new ObjectManager($this);
6868
$this->observerMock = $this->createMock(Observer::class);
@@ -90,7 +90,7 @@ protected function setUp() : void
9090
/**
9191
* Test observer execute method
9292
*/
93-
public function testExecuteModifySpecialFromDate()
93+
public function testExecuteModifySpecialFromDate(): void
9494
{
9595
$specialPrice = 15;
9696
$specialFromDate = null;
@@ -108,12 +108,12 @@ public function testExecuteModifySpecialFromDate()
108108

109109
$this->dateObject->expects($this->any())
110110
->method('setTime')
111-
->will($this->returnSelf());
111+
->willReturnSelf();
112112

113113
$this->timezone
114114
->expects($this->once())
115115
->method('date')
116-
->will($this->returnValue($this->dateObject));
116+
->willReturn($this->dateObject);
117117

118118
$this->productMock
119119
->expects($this->once())

0 commit comments

Comments
 (0)