11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2016 Adobe
4+ * All Rights Reserved .
55 */
66declare (strict_types=1 );
77
88namespace Magento \Customer \Test \Unit \Model \ResourceModel \Db \VersionControl ;
99
1010use Magento \Customer \Model \ResourceModel \Db \VersionControl \AddressSnapshot ;
1111use Magento \Framework \DataObject ;
12+ use Magento \Framework \Exception \LocalizedException ;
1213use Magento \Framework \Model \ResourceModel \Db \VersionControl \Metadata ;
14+ use Magento \Framework \Serialize \SerializerInterface ;
1315use PHPUnit \Framework \MockObject \MockObject ;
1416use PHPUnit \Framework \TestCase ;
1517
@@ -18,22 +20,30 @@ class AddressSnapshotTest extends TestCase
1820 /**
1921 * @var AddressSnapshot
2022 */
21- private $ model ;
23+ private AddressSnapshot $ model ;
2224
2325 /**
2426 * @var Metadata|MockObject
2527 */
26- private $ metadataMock ;
28+ private Metadata $ metadataMock ;
2729
30+ /**
31+ * @var SerializerInterface|MockObject
32+ */
33+ private SerializerInterface $ serializer ;
34+
35+ /**
36+ * @return void
37+ * @throws \PHPUnit\Framework\MockObject\Exception
38+ */
2839 protected function setUp (): void
2940 {
30- $ this ->metadataMock = $ this ->getMockBuilder (
31- Metadata::class
32- )->disableOriginalConstructor ()
33- ->getMock ();
41+ $ this ->metadataMock = $ this ->createMock (Metadata::class);
42+ $ this ->serializer = $ this ->createMock (SerializerInterface::class);
3443
3544 $ this ->model = new AddressSnapshot (
36- $ this ->metadataMock
45+ $ this ->metadataMock ,
46+ $ this ->serializer
3747 );
3848 }
3949
@@ -43,13 +53,10 @@ protected function setUp(): void
4353 * @param int $isDefaultShipping
4454 * @param bool $expected
4555 * @dataProvider dataProviderIsModified
56+ * @throws LocalizedException
4657 */
47- public function testIsModified (
48- $ isCustomerSaveTransaction ,
49- $ isDefaultBilling ,
50- $ isDefaultShipping ,
51- $ expected
52- ) {
58+ public function testIsModified ($ isCustomerSaveTransaction , $ isDefaultBilling , $ isDefaultShipping , $ expected ): void
59+ {
5360 $ entityId = 1 ;
5461
5562 $ dataObjectMock = $ this ->getMockBuilder (DataObject::class)
@@ -96,7 +103,7 @@ public function testIsModified(
96103 /**
97104 * @return array
98105 */
99- public static function dataProviderIsModified ()
106+ public static function dataProviderIsModified (): array
100107 {
101108 return [
102109 [false , 1 , 1 , true ],
@@ -106,7 +113,11 @@ public static function dataProviderIsModified()
106113 ];
107114 }
108115
109- public function testIsModifiedBypass ()
116+ /**
117+ * @return void
118+ * @throws LocalizedException
119+ */
120+ public function testIsModifiedBypass (): void
110121 {
111122 $ dataObjectMock = $ this ->getMockBuilder (DataObject::class)
112123 ->disableOriginalConstructor ()
0 commit comments