@@ -64,34 +64,34 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase
64
64
65
65
protected function setUp ()
66
66
{
67
- $ this ->addressFactory = $ this ->getMock (' Magento\Customer\Model\AddressFactory ' , ['create ' ], [], '' , false );
68
- $ this ->addressRegistry = $ this ->getMock (' Magento\Customer\Model\AddressRegistry ' , [], [], '' , false );
69
- $ this ->customerRegistry = $ this ->getMock (' Magento\Customer\Model\CustomerRegistry ' , [], [], '' , false );
70
- $ this ->addressResourceModel = $ this ->getMock (' Magento\Customer\Model\ResourceModel\Address ' , [], [], '' , false );
71
- $ this ->directoryData = $ this ->getMock (' Magento\Directory\Helper\Data ' , [], [], '' , false );
67
+ $ this ->addressFactory = $ this ->getMock (\ Magento \Customer \Model \AddressFactory::class , ['create ' ], [], '' , false );
68
+ $ this ->addressRegistry = $ this ->getMock (\ Magento \Customer \Model \AddressRegistry::class , [], [], '' , false );
69
+ $ this ->customerRegistry = $ this ->getMock (\ Magento \Customer \Model \CustomerRegistry::class , [], [], '' , false );
70
+ $ this ->addressResourceModel = $ this ->getMock (\ Magento \Customer \Model \ResourceModel \Address::class , [], [], '' , false );
71
+ $ this ->directoryData = $ this ->getMock (\ Magento \Directory \Helper \Data::class , [], [], '' , false );
72
72
$ this ->addressSearchResultsFactory = $ this ->getMock (
73
- ' Magento\Customer\Api\Data\AddressSearchResultsInterfaceFactory ' ,
73
+ \ Magento \Customer \Api \Data \AddressSearchResultsInterfaceFactory::class ,
74
74
['create ' ],
75
75
[],
76
76
'' ,
77
77
false
78
78
);
79
79
$ this ->addressCollectionFactory = $ this ->getMock (
80
- ' Magento\Customer\Model\ResourceModel\Address\CollectionFactory ' ,
80
+ \ Magento \Customer \Model \ResourceModel \Address \CollectionFactory::class ,
81
81
['create ' ],
82
82
[],
83
83
'' ,
84
84
false
85
85
);
86
86
$ this ->extensionAttributesJoinProcessor = $ this ->getMockForAbstractClass (
87
- ' Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface ' ,
87
+ \ Magento \Framework \Api \ExtensionAttribute \JoinProcessorInterface::class ,
88
88
[],
89
89
'' ,
90
90
false
91
91
);
92
- $ this ->customer = $ this ->getMock (' Magento\Customer\Model\Customer ' , [], [], '' , false );
92
+ $ this ->customer = $ this ->getMock (\ Magento \Customer \Model \Customer::class , [], [], '' , false );
93
93
$ this ->address = $ this ->getMock (
94
- ' Magento\Customer\Model\Address ' ,
94
+ \ Magento \Customer \Model \Address::class ,
95
95
[
96
96
'getId ' ,
97
97
'getCountryId ' ,
@@ -130,9 +130,9 @@ public function testSave()
130
130
{
131
131
$ customerId = 34 ;
132
132
$ addressId = 53 ;
133
- $ customerAddress = $ this ->getMockForAbstractClass (' Magento\Customer\Api\Data\AddressInterface ' , [], '' , false );
133
+ $ customerAddress = $ this ->getMockForAbstractClass (\ Magento \Customer \Api \Data \AddressInterface::class , [], '' , false );
134
134
$ addressCollection =
135
- $ this ->getMock (' Magento\Customer\Model\ResourceModel\Address\Collection ' , [], [], '' , false );
135
+ $ this ->getMock (\ Magento \Customer \Model \ResourceModel \Address \Collection::class , [], [], '' , false );
136
136
$ customerAddress ->expects ($ this ->atLeastOnce ())
137
137
->method ('getCustomerId ' )
138
138
->willReturn ($ customerId );
@@ -190,7 +190,7 @@ public function testSaveWithException()
190
190
{
191
191
$ customerId = 34 ;
192
192
$ addressId = 53 ;
193
- $ customerAddress = $ this ->getMockForAbstractClass (' Magento\Customer\Api\Data\AddressInterface ' , [], '' , false );
193
+ $ customerAddress = $ this ->getMockForAbstractClass (\ Magento \Customer \Api \Data \AddressInterface::class , [], '' , false );
194
194
$ customerAddress ->expects ($ this ->atLeastOnce ())
195
195
->method ('getCustomerId ' )
196
196
->willReturn ($ customerId );
@@ -215,9 +215,9 @@ public function testSaveWithException()
215
215
216
216
protected function prepareMocksForInvalidAddressValidation ()
217
217
{
218
- $ countryModel = $ this ->getMock (' Magento\Directory\Model\Country ' , [], [], '' , false );
218
+ $ countryModel = $ this ->getMock (\ Magento \Directory \Model \Country::class , [], [], '' , false );
219
219
$ regionCollection = $ this ->getMock (
220
- ' Magento\Directory\Model\ResourceModel\Region\Collection ' ,
220
+ \ Magento \Directory \Model \ResourceModel \Region \Collection::class ,
221
221
[],
222
222
[],
223
223
'' ,
@@ -264,7 +264,7 @@ protected function prepareMocksForInvalidAddressValidation()
264
264
265
265
public function testGetById ()
266
266
{
267
- $ customerAddress = $ this ->getMockForAbstractClass (' Magento\Customer\Api\Data\AddressInterface ' , [], '' , false );
267
+ $ customerAddress = $ this ->getMockForAbstractClass (\ Magento \Customer \Api \Data \AddressInterface::class , [], '' , false );
268
268
$ this ->addressRegistry ->expects ($ this ->once ())
269
269
->method ('retrieve ' )
270
270
->with (12 )
@@ -278,17 +278,17 @@ public function testGetById()
278
278
279
279
public function testGetList ()
280
280
{
281
- $ filterGroup = $ this ->getMock (' Magento\Framework\Api\Search\FilterGroup ' , [], [], '' , false );
282
- $ filter = $ this ->getMock (' Magento\Framework\Api\Filter ' , [], [], '' , false );
283
- $ collection = $ this ->getMock (' Magento\Customer\Model\ResourceModel\Address\Collection ' , [], [], '' , false );
281
+ $ filterGroup = $ this ->getMock (\ Magento \Framework \Api \Search \FilterGroup::class , [], [], '' , false );
282
+ $ filter = $ this ->getMock (\ Magento \Framework \Api \Filter::class , [], [], '' , false );
283
+ $ collection = $ this ->getMock (\ Magento \Customer \Model \ResourceModel \Address \Collection::class , [], [], '' , false );
284
284
$ searchResults = $ this ->getMockForAbstractClass (
285
- ' Magento\Customer\Api\Data\AddressSearchResultsInterface ' ,
285
+ \ Magento \Customer \Api \Data \AddressSearchResultsInterface::class ,
286
286
[],
287
287
'' ,
288
288
false
289
289
);
290
290
$ searchCriteria = $ this ->getMockForAbstractClass (
291
- ' Magento\Framework\Api\SearchCriteriaInterface ' ,
291
+ \ Magento \Framework \Api \SearchCriteriaInterface::class ,
292
292
[],
293
293
'' ,
294
294
false
@@ -301,7 +301,7 @@ public function testGetList()
301
301
->willReturn ($ collection );
302
302
$ this ->extensionAttributesJoinProcessor ->expects ($ this ->once ())
303
303
->method ('process ' )
304
- ->with ($ collection , ' Magento\Customer\Api\Data\AddressInterface ' );
304
+ ->with ($ collection , \ Magento \Customer \Api \Data \AddressInterface::class );
305
305
$ searchCriteria ->expects ($ this ->once ())
306
306
->method ('getFilterGroups ' )
307
307
->willReturn ([$ filterGroup ]);
@@ -326,7 +326,7 @@ public function testGetList()
326
326
$ searchResults ->expects ($ this ->once ())
327
327
->method ('setTotalCount ' )
328
328
->with (23 );
329
- $ sortOrder = $ this ->getMock (' Magento\Framework\Api\SortOrder ' , [], [], '' , false );
329
+ $ sortOrder = $ this ->getMock (\ Magento \Framework \Api \SortOrder::class , [], [], '' , false );
330
330
$ searchCriteria ->expects ($ this ->once ())
331
331
->method ('getSortOrders ' )
332
332
->willReturn ([$ sortOrder ]);
@@ -357,7 +357,7 @@ public function testGetList()
357
357
$ this ->address ->expects ($ this ->once ())
358
358
->method ('getId ' )
359
359
->willReturn (12 );
360
- $ customerAddress = $ this ->getMockForAbstractClass (' Magento\Customer\Api\Data\AddressInterface ' , [], '' , false );
360
+ $ customerAddress = $ this ->getMockForAbstractClass (\ Magento \Customer \Api \Data \AddressInterface::class , [], '' , false );
361
361
$ this ->addressRegistry ->expects ($ this ->once ())
362
362
->method ('retrieve ' )
363
363
->with (12 )
@@ -381,13 +381,13 @@ public function testDelete()
381
381
$ customerId = 43 ;
382
382
383
383
$ addressCollection = $ this ->getMock (
384
- ' Magento\Customer\Model\ResourceModel\Address\Collection ' ,
384
+ \ Magento \Customer \Model \ResourceModel \Address \Collection::class ,
385
385
[],
386
386
[],
387
387
'' ,
388
388
false
389
389
);
390
- $ customerAddress = $ this ->getMockForAbstractClass (' Magento\Customer\Api\Data\AddressInterface ' , [], '' , false );
390
+ $ customerAddress = $ this ->getMockForAbstractClass (\ Magento \Customer \Api \Data \AddressInterface::class , [], '' , false );
391
391
$ customerAddress ->expects ($ this ->once ())
392
392
->method ('getId ' )
393
393
->willReturn ($ addressId );
@@ -428,7 +428,7 @@ public function testDeleteById()
428
428
->method ('getCustomerId ' )
429
429
->willReturn ($ customerId );
430
430
$ addressCollection = $ this ->getMock (
431
- ' Magento\Customer\Model\ResourceModel\Address\Collection ' ,
431
+ \ Magento \Customer \Model \ResourceModel \Address \Collection::class ,
432
432
[],
433
433
[],
434
434
'' ,
0 commit comments