@@ -52,119 +52,95 @@ public function testProductTotals($condition, $expectedTotal, $expectedDisabled)
52
52
public function productDataProvider ()
53
53
{
54
54
return [
55
- // category with no products
56
- [
57
- [
58
- '1 ' => [
59
- 'aggregator ' => 'all ' ,
60
- 'new_child ' => '' ,
61
- 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
62
- 'value ' => '1 ' ,
55
+ [ // category with no products
56
+ ['1 ' => [
57
+ 'aggregator ' => 'all ' ,
58
+ 'new_child ' => '' ,
59
+ 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
60
+ 'value ' => '1 ' ,
63
61
],
64
62
'1--1 ' => [
65
63
'operator ' => '== ' ,
66
64
'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Product::class,
67
65
'attribute ' => 'category_ids ' ,
68
66
'value ' => '4 '
69
- ],
70
- ],
71
- 0 ,
72
- 0
67
+ ]
68
+ ], 0 , 0
73
69
],
74
- // category with 4 products, 1 disabled
75
- [
76
- [
77
- '1 ' => [
78
- 'aggregator ' => 'all ' ,
79
- 'new_child ' => '' ,
80
- 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
81
- 'value ' => '1 ' ,
70
+ [ // category with 4 products, 1 disabled
71
+ ['1 ' => [
72
+ 'aggregator ' => 'all ' ,
73
+ 'new_child ' => '' ,
74
+ 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
75
+ 'value ' => '1 ' ,
82
76
],
83
77
'1--1 ' => [
84
78
'operator ' => '== ' ,
85
79
'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Product::class,
86
80
'attribute ' => 'category_ids ' ,
87
81
'value ' => '3 '
88
- ],
89
- ],
90
- 4 ,
91
- 1
82
+ ]
83
+ ], 4 , 1
92
84
],
93
- // sku with no matches
94
- [
95
- [
96
- '1 ' => [
97
- 'aggregator ' => 'all ' ,
98
- 'new_child ' => '' ,
99
- 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
100
- 'value ' => '1 ' ,
85
+ [ // sku with no matches
86
+ ['1 ' => [
87
+ 'aggregator ' => 'all ' ,
88
+ 'new_child ' => '' ,
89
+ 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
90
+ 'value ' => '1 ' ,
101
91
],
102
92
'1--1 ' => [
103
93
'operator ' => '() ' ,
104
94
'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Product::class,
105
95
'attribute ' => 'sku ' ,
106
96
'value ' => 'shoes '
107
- ],
108
- ],
109
- 0 ,
110
- 0
97
+ ]
98
+ ], 0 , 0
111
99
],
112
- // sku with 2 matches, 1 disabled
113
- [
114
- [
115
- '1 ' => [
116
- 'aggregator ' => 'all ' ,
117
- 'new_child ' => '' ,
118
- 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
119
- 'value ' => '1 ' ,
100
+ [ // sku with 2 matches, 1 disabled
101
+ ['1 ' => [
102
+ 'aggregator ' => 'all ' ,
103
+ 'new_child ' => '' ,
104
+ 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
105
+ 'value ' => '1 ' ,
120
106
],
121
107
'1--1 ' => [
122
108
'operator ' => '() ' ,
123
109
'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Product::class,
124
110
'attribute ' => 'sku ' ,
125
111
'value ' => 'simple-3, simple-4 '
126
- ],
127
- ],
128
- 2 ,
129
- 1
112
+ ]
113
+ ], 2 , 1
130
114
],
131
- // condition with no matches
132
- [
133
- [
134
- '1 ' => [
135
- 'aggregator ' => 'all ' ,
136
- 'new_child ' => '' ,
137
- 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
138
- 'value ' => '1 ' ,
115
+ [ // condition with no matches
116
+ ['1 ' => [
117
+ 'aggregator ' => 'all ' ,
118
+ 'new_child ' => '' ,
119
+ 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
120
+ 'value ' => '1 ' ,
139
121
],
140
122
'1--1 ' => [
141
123
'operator ' => '>= ' ,
142
124
'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Product::class,
143
125
'attribute ' => 'price ' ,
144
126
'value ' => '10000 '
145
- ],
146
- ],
147
- 0 ,
148
- 0
127
+ ]
128
+ ], 0 , 0
149
129
],
150
- // condition with 3 matches, 1 disabled
151
- [
152
- [
153
- '1 ' => [
154
- 'aggregator ' => 'all ' ,
155
- 'new_child ' => '' ,
156
- 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
157
- 'value ' => '1 ' ,
130
+ [ // condition with 3 matches, 1 disabled
131
+ ['1 ' => [
132
+ 'aggregator ' => 'all ' ,
133
+ 'new_child ' => '' ,
134
+ 'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Combine::class,
135
+ 'value ' => '1 ' ,
158
136
],
159
137
'1--1 ' => [
160
138
'operator ' => '< ' ,
161
139
'type ' => \Magento \CatalogWidget \Model \Rule \Condition \Product::class,
162
140
'attribute ' => 'price ' ,
163
141
'value ' => '20 '
164
- ],
165
- ],
166
- 3 ,
167
- 1
142
+ ]
143
+ ], 3 , 1
168
144
],
169
145
];
170
146
}
0 commit comments