Skip to content

Commit e7a32ec

Browse files
Refactored code to fix the coding style error
1 parent 82a5124 commit e7a32ec

File tree

1 file changed

+139
-98
lines changed
  • app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier

1 file changed

+139
-98
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php

Lines changed: 139 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -533,106 +533,147 @@ public function testSetupAttributeMetaDefaultAttribute($productId, $productRequi
533533
public function setupAttributeMetaDataProvider()
534534
{
535535
return [
536-
'default_null_prod_not_new_and_required' => [
537-
'productId' => 1,
538-
'productRequired' => true,
539-
'attrValue' => 'val',
540-
'note' => null,
541-
'expected' => [
542-
'dataType' => null,
543-
'formElement' => null,
544-
'visible' => null,
545-
'required' => true,
546-
'notice' => null,
547-
'default' => null,
548-
'label' => null,
549-
'code' => 'code',
550-
'source' => 'product-details',
551-
'scopeLabel' => '',
552-
'globalScope' => false,
553-
'sortOrder' => 0
554-
],
555-
],
556-
'default_null_prod_not_new_and_not_required' => [
557-
'productId' => 1,
558-
'productRequired' => false,
559-
'attrValue' => 'val',
560-
'note' => null,
561-
'expected' => [
562-
'dataType' => null,
563-
'formElement' => null,
564-
'visible' => null,
565-
'required' => false,
566-
'notice' => null,
567-
'default' => null,
568-
'label' => null,
569-
'code' => 'code',
570-
'source' => 'product-details',
571-
'scopeLabel' => '',
572-
'globalScope' => false,
573-
'sortOrder' => 0
574-
],
575-
],
576-
'default_null_prod_new_and_not_required' => [
577-
'productId' => null,
578-
'productRequired' => false,
579-
'attrValue' => null,
580-
'note' => null,
581-
'expected' => [
582-
'dataType' => null,
583-
'formElement' => null,
584-
'visible' => null,
585-
'required' => false,
586-
'notice' => null,
587-
'default' => 'required_value',
588-
'label' => null,
589-
'code' => 'code',
590-
'source' => 'product-details',
591-
'scopeLabel' => '',
592-
'globalScope' => false,
593-
'sortOrder' => 0
594-
],
536+
'default_null_prod_not_new_and_required' => $this->defaultNullProdNotNewAndRequired(),
537+
'default_null_prod_not_new_and_not_required' => $this->defaultNullProdNotNewAndNotRequired(),
538+
'default_null_prod_new_and_not_required' => $this->defaultNullProdNewAndNotRequired(),
539+
'default_null_prod_new_and_required' => $this->defaultNullProdNewAndRequired(),
540+
'default_null_prod_new_and_required_and_filled_notice' => $this->defaultNullProdNewAndRequiredAndFilledNotice(
541+
)
542+
];
543+
}
544+
545+
/**
546+
* @return array
547+
*/
548+
private function defaultNullProdNotNewAndRequired()
549+
{
550+
return [
551+
'productId' => 1,
552+
'productRequired' => true,
553+
'attrValue' => 'val',
554+
'note' => null,
555+
'expected' => [
556+
'dataType' => null,
557+
'formElement' => null,
558+
'visible' => null,
559+
'required' => true,
560+
'notice' => null,
561+
'default' => null,
562+
'label' => null,
563+
'code' => 'code',
564+
'source' => 'product-details',
565+
'scopeLabel' => '',
566+
'globalScope' => false,
567+
'sortOrder' => 0
595568
],
596-
'default_null_prod_new_and_required' => [
597-
'productId' => null,
598-
'productRequired' => false,
599-
'attrValue' => null,
600-
'note' => null,
601-
'expected' => [
602-
'dataType' => null,
603-
'formElement' => null,
604-
'visible' => null,
605-
'required' => false,
606-
'notice' => null,
607-
'default' => 'required_value',
608-
'label' => null,
609-
'code' => 'code',
610-
'source' => 'product-details',
611-
'scopeLabel' => '',
612-
'globalScope' => false,
613-
'sortOrder' => 0
614-
],
569+
];
570+
}
571+
572+
/**
573+
* @return array
574+
*/
575+
private function defaultNullProdNotNewAndNotRequired()
576+
{
577+
return [
578+
'productId' => 1,
579+
'productRequired' => false,
580+
'attrValue' => 'val',
581+
'note' => null,
582+
'expected' => [
583+
'dataType' => null,
584+
'formElement' => null,
585+
'visible' => null,
586+
'required' => false,
587+
'notice' => null,
588+
'default' => null,
589+
'label' => null,
590+
'code' => 'code',
591+
'source' => 'product-details',
592+
'scopeLabel' => '',
593+
'globalScope' => false,
594+
'sortOrder' => 0
595+
],
596+
];
597+
}
598+
599+
/**
600+
* @return array
601+
*/
602+
private function defaultNullProdNewAndNotRequired()
603+
{
604+
return [
605+
'productId' => null,
606+
'productRequired' => false,
607+
'attrValue' => null,
608+
'note' => null,
609+
'expected' => [
610+
'dataType' => null,
611+
'formElement' => null,
612+
'visible' => null,
613+
'required' => false,
614+
'notice' => null,
615+
'default' => 'required_value',
616+
'label' => null,
617+
'code' => 'code',
618+
'source' => 'product-details',
619+
'scopeLabel' => '',
620+
'globalScope' => false,
621+
'sortOrder' => 0
622+
],
623+
];
624+
}
625+
626+
/**
627+
* @return array
628+
*/
629+
private function defaultNullProdNewAndRequired()
630+
{
631+
return [
632+
'productId' => null,
633+
'productRequired' => false,
634+
'attrValue' => null,
635+
'note' => null,
636+
'expected' => [
637+
'dataType' => null,
638+
'formElement' => null,
639+
'visible' => null,
640+
'required' => false,
641+
'notice' => null,
642+
'default' => 'required_value',
643+
'label' => null,
644+
'code' => 'code',
645+
'source' => 'product-details',
646+
'scopeLabel' => '',
647+
'globalScope' => false,
648+
'sortOrder' => 0
649+
],
650+
];
651+
}
652+
653+
/**
654+
* @return array
655+
*/
656+
private function defaultNullProdNewAndRequiredAndFilledNotice()
657+
{
658+
return [
659+
'productId' => null,
660+
'productRequired' => false,
661+
'attrValue' => null,
662+
'note' => 'example notice',
663+
'expected' => [
664+
'dataType' => null,
665+
'formElement' => null,
666+
'visible' => null,
667+
'required' => false,
668+
'notice' => __('example notice'),
669+
'default' => 'required_value',
670+
'label' => null,
671+
'code' => 'code',
672+
'source' => 'product-details',
673+
'scopeLabel' => '',
674+
'globalScope' => false,
675+
'sortOrder' => 0
615676
],
616-
'default_null_prod_new_and_required_and_filled_notice' => [
617-
'productId' => null,
618-
'productRequired' => false,
619-
'attrValue' => null,
620-
'note' => 'example notice',
621-
'expected' => [
622-
'dataType' => null,
623-
'formElement' => null,
624-
'visible' => null,
625-
'required' => false,
626-
'notice' => __('example notice'),
627-
'default' => 'required_value',
628-
'label' => null,
629-
'code' => 'code',
630-
'source' => 'product-details',
631-
'scopeLabel' => '',
632-
'globalScope' => false,
633-
'sortOrder' => 0
634-
],
635-
]
636677
];
637678
}
638679
}

0 commit comments

Comments
 (0)