@@ -338,20 +338,16 @@ protected function getTypeAddressMock()
338
338
return $ typeAddressMock ;
339
339
}
340
340
341
+ /**
342
+ * @param \PHPUnit_Framework_MockObject_MockObject $attributeMock
343
+ * @param \PHPUnit_Framework_MockObject_MockObject $attributeBooleanMock
344
+ * @param array $options
345
+ */
341
346
private function injectVisibilityProps (
342
347
\PHPUnit_Framework_MockObject_MockObject $ attributeMock ,
343
348
\PHPUnit_Framework_MockObject_MockObject $ attributeBooleanMock ,
344
349
array $ options = []
345
350
) {
346
- $ attributeCode = self ::ATTRIBUTE_CODE ;
347
- if (isset ($ options [self ::ATTRIBUTE_CODE ]['specific_code_prefix ' ])) {
348
- $ attributeCode = $ attributeCode . $ options [self ::ATTRIBUTE_CODE ]['specific_code_prefix ' ];
349
- }
350
-
351
- $ attributeMock ->expects ($ this ->exactly (2 ))
352
- ->method ('getAttributeCode ' )
353
- ->willReturn ($ attributeCode );
354
-
355
351
if (isset ($ options [self ::ATTRIBUTE_CODE ]['visible ' ])) {
356
352
$ attributeMock ->expects ($ this ->any ())
357
353
->method ('getIsVisible ' )
@@ -370,15 +366,6 @@ private function injectVisibilityProps(
370
366
->willReturn ($ options [self ::ATTRIBUTE_CODE ]['is_used_in_forms ' ]);
371
367
}
372
368
373
- $ booleanAttributeCode = 'test-code-boolean ' ;
374
- if (isset ($ options ['test-code-boolean ' ]['specific_code_prefix ' ])) {
375
- $ booleanAttributeCode = $ booleanAttributeCode . $ options ['test-code-boolean ' ]['specific_code_prefix ' ];
376
- }
377
-
378
- $ attributeBooleanMock ->expects ($ this ->exactly (2 ))
379
- ->method ('getAttributeCode ' )
380
- ->willReturn ($ booleanAttributeCode );
381
-
382
369
if (isset ($ options ['test-code-boolean ' ]['visible ' ])) {
383
370
$ attributeBooleanMock ->expects ($ this ->any ())
384
371
->method ('getIsVisible ' )
@@ -423,6 +410,15 @@ protected function getAttributeMock($type = 'customer', $options = [])
423
410
->disableOriginalConstructor ()
424
411
->getMockForAbstractClass ();
425
412
413
+ $ attributeCode = self ::ATTRIBUTE_CODE ;
414
+ if (isset ($ options [self ::ATTRIBUTE_CODE ]['specific_code_prefix ' ])) {
415
+ $ attributeCode = $ attributeCode . $ options [self ::ATTRIBUTE_CODE ]['specific_code_prefix ' ];
416
+ }
417
+
418
+ $ attributeMock ->expects ($ this ->exactly (2 ))
419
+ ->method ('getAttributeCode ' )
420
+ ->willReturn ($ attributeCode );
421
+
426
422
$ sourceMock ->expects ($ this ->any ())
427
423
->method ('getAllOptions ' )
428
424
->willReturn (self ::OPTIONS_RESULT );
@@ -473,6 +469,14 @@ function ($origName) {
473
469
$ attributeBooleanMock ->expects ($ this ->once ())
474
470
->method ('usesSource ' )
475
471
->willReturn (false );
472
+ $ booleanAttributeCode = 'test-code-boolean ' ;
473
+ if (isset ($ options ['test-code-boolean ' ]['specific_code_prefix ' ])) {
474
+ $ booleanAttributeCode = $ booleanAttributeCode . $ options ['test-code-boolean ' ]['specific_code_prefix ' ];
475
+ }
476
+
477
+ $ attributeBooleanMock ->expects ($ this ->exactly (2 ))
478
+ ->method ('getAttributeCode ' )
479
+ ->willReturn ($ booleanAttributeCode );
476
480
477
481
$ this ->eavValidationRulesMock ->expects ($ this ->any ())
478
482
->method ('build ' )
0 commit comments