Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PatternTest.php
Go to the documentation of this file.
1 <?php
8 
12 class PatternTest extends \PHPUnit\Framework\TestCase
13 {
14  public function testGenerateAttributeSet()
15  {
16  $attributeSets = [
17  'name' => 'attribute set name',
18  'attributes' => [
19  'attribute' => [
20  [
21  'is_required' => 1,
22  'is_visible_on_front' => 1,
23  'is_visible_in_advanced_search' => 0,
24  'is_filterable' => 0,
25  'is_filterable_in_search' => 0,
26  'attribute_code' => 'attribute_1',
27  'is_searchable' => 0,
28  'frontend_label' => 'Attribute 1',
29  'frontend_input' => 'select',
30  'backend_type' => 1,
31  'default_option' => 'option 1',
32  'options' => [
33  'option' => [
34  [
35  'label' => 'option 1',
36  'value' => 'option_1'
37  ],
38  [
39  'label' => 'option 2',
40  'value' => 'option_2'
41  ]
42  ]
43  ]
44  ]
45  ]
46  ]
47  ];
48  $pattern = new \Magento\Setup\Fixtures\AttributeSet\Pattern();
49  $this->assertEquals(
50  $attributeSets,
51  $pattern->generateAttributeSet(
52  'attribute set name',
53  1,
54  2,
56  $attributeData['backend_type'] = $index;
57  return $attributeData;
58  }
59  )
60  );
61  }
62 }
$pattern
Definition: website.php:22
else function()
$index
Definition: list.phtml:44