15
15
use Magento \Catalog \Model \Product ;
16
16
use Magento \Webapi \Controller \Rest \Router \Route ;
17
17
use Magento \Catalog \Api \ProductRepositoryInterface ;
18
+ use PHPUnit_Framework_MockObject_MockObject as MockObject ;
18
19
19
20
/**
20
21
* Unit test for InputParamsResolver plugin
@@ -42,22 +43,22 @@ class InputParamsResolverTest extends \PHPUnit\Framework\TestCase
42
43
private $ objectManager ;
43
44
44
45
/**
45
- * @var InputParamsResolver|\PHPUnit_Framework_MockObject_MockObject
46
+ * @var InputParamsResolver|MockObject
46
47
*/
47
48
private $ subject ;
48
49
49
50
/**
50
- * @var RestRequest|\PHPUnit_Framework_MockObject_MockObject
51
+ * @var RestRequest|MockObject
51
52
*/
52
53
private $ request ;
53
54
54
55
/**
55
- * @var Product|\PHPUnit_Framework_MockObject_MockObject
56
+ * @var Product|MockObject
56
57
*/
57
58
private $ product ;
58
59
59
60
/**
60
- * @var Route|\PHPUnit_Framework_MockObject_MockObject
61
+ * @var Route|MockObject
61
62
*/
62
63
private $ route ;
63
64
@@ -76,16 +77,21 @@ protected function setUp()
76
77
'product ' => [
77
78
'sku ' => 'test ' ,
78
79
'custom_attributes ' => [
79
- ['attribute_code ' => $ this ->saveRewritesHistory , 'value ' => 1 ]
80
+ [
81
+ 'attribute_code ' => $ this ->saveRewritesHistory ,
82
+ 'value ' => 1
83
+ ]
80
84
]
81
85
]
82
86
];
83
87
84
88
$ this ->route = $ this ->createPartialMock (Route::class, ['getServiceMethod ' , 'getServiceClass ' ]);
85
89
$ this ->request = $ this ->createPartialMock (RestRequest::class, ['getBodyParams ' ]);
86
- $ this ->request ->expects ($ this ->any ())->method ('getBodyParams ' )->willReturn ($ this ->requestBodyParams );
90
+ $ this ->request ->method ('getBodyParams ' )
91
+ ->willReturn ($ this ->requestBodyParams );
87
92
$ this ->subject = $ this ->createPartialMock (InputParamsResolver::class, ['getRoute ' ]);
88
- $ this ->subject ->expects ($ this ->any ())->method ('getRoute ' )->willReturn ($ this ->route );
93
+ $ this ->subject ->method ('getRoute ' )
94
+ ->willReturn ($ this ->route );
89
95
$ this ->product = $ this ->createPartialMock (Product::class, ['setData ' ]);
90
96
91
97
$ this ->result = [false , $ this ->product , 'test ' ];
0 commit comments