8
8
9
9
namespace Magento \Catalog \Test \Unit \Observer ;
10
10
11
+ use Magento \Catalog \Model \Product ;
12
+ use Magento \Catalog \Observer \SetSpecialPriceStartDate ;
11
13
use Magento \Framework \Event ;
12
14
use Magento \Framework \Event \Observer ;
13
- use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
14
15
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 ;
18
17
use PHPUnit \Framework \MockObject \MockObject ;
18
+ use PHPUnit \Framework \TestCase ;
19
19
20
20
/**
21
21
* Unit test for \Magento\Catalog\Observer\SetSpecialPriceStartDate
@@ -62,7 +62,7 @@ class SetSpecialPriceStartDateTest extends TestCase
62
62
/**
63
63
* @inheritdoc
64
64
*/
65
- protected function setUp () : void
65
+ protected function setUp (): void
66
66
{
67
67
$ this ->objectManager = new ObjectManager ($ this );
68
68
$ this ->observerMock = $ this ->createMock (Observer::class);
@@ -90,7 +90,7 @@ protected function setUp() : void
90
90
/**
91
91
* Test observer execute method
92
92
*/
93
- public function testExecuteModifySpecialFromDate ()
93
+ public function testExecuteModifySpecialFromDate (): void
94
94
{
95
95
$ specialPrice = 15 ;
96
96
$ specialFromDate = null ;
@@ -108,12 +108,12 @@ public function testExecuteModifySpecialFromDate()
108
108
109
109
$ this ->dateObject ->expects ($ this ->any ())
110
110
->method ('setTime ' )
111
- ->will ( $ this -> returnSelf () );
111
+ ->willReturnSelf ( );
112
112
113
113
$ this ->timezone
114
114
->expects ($ this ->once ())
115
115
->method ('date ' )
116
- ->will ($ this ->returnValue ( $ this -> dateObject ) );
116
+ ->willReturn ($ this ->dateObject );
117
117
118
118
$ this ->productMock
119
119
->expects ($ this ->once ())
0 commit comments