@@ -50,13 +50,13 @@ public function testCreatePromotion() {
50
50
$ this ->getSession ()->getPage ()->fillField ('name[0][value] ' , $ name );
51
51
$ this ->getSession ()->getPage ()->selectFieldOption ('offer[0][target_plugin_id] ' , 'order_item_percentage_off ' );
52
52
$ this ->waitForAjaxToFinish ();
53
- $ this ->getSession ()->getPage ()->fillField ('offer[0][target_plugin_configuration][order_item_percentage_off][amount ] ' , '10.0 ' );
53
+ $ this ->getSession ()->getPage ()->fillField ('offer[0][target_plugin_configuration][order_item_percentage_off][percentage ] ' , '10.0 ' );
54
54
55
55
// Change, assert any values reset.
56
56
$ this ->getSession ()->getPage ()->selectFieldOption ('offer[0][target_plugin_id] ' , 'order_percentage_off ' );
57
57
$ this ->waitForAjaxToFinish ();
58
- $ this ->assertSession ()->fieldValueNotEquals ('offer[0][target_plugin_configuration][order_percentage_off][amount ] ' , '10.0 ' );
59
- $ this ->getSession ()->getPage ()->fillField ('offer[0][target_plugin_configuration][order_percentage_off][amount ] ' , '10.0 ' );
58
+ $ this ->assertSession ()->fieldValueNotEquals ('offer[0][target_plugin_configuration][order_percentage_off][percentage ] ' , '10.0 ' );
59
+ $ this ->getSession ()->getPage ()->fillField ('offer[0][target_plugin_configuration][order_percentage_off][percentage ] ' , '10.0 ' );
60
60
61
61
// Confirm the integrity of the conditions UI.
62
62
foreach (['order ' , 'product ' , 'customer ' ] as $ condition_group ) {
@@ -86,7 +86,7 @@ public function testCreatePromotion() {
86
86
$ promotion = Promotion::load (1 );
87
87
/** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
88
88
$ offer_field = $ promotion ->get ('offer ' )->first ();
89
- $ this ->assertEquals ('0.10 ' , $ offer_field ->target_plugin_configuration ['amount ' ]);
89
+ $ this ->assertEquals ('0.10 ' , $ offer_field ->target_plugin_configuration ['percentage ' ]);
90
90
91
91
/** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $condition_field */
92
92
$ condition_field = $ promotion ->get ('conditions ' )->first ();
@@ -115,7 +115,7 @@ public function testCreatePromotionWithEndDate() {
115
115
$ name = $ this ->randomMachineName (8 );
116
116
$ edit = [
117
117
'name[0][value] ' => $ name ,
118
- 'offer[0][target_plugin_configuration][order_percentage_off][amount ] ' => '10.0 ' ,
118
+ 'offer[0][target_plugin_configuration][order_percentage_off][percentage ] ' => '10.0 ' ,
119
119
];
120
120
121
121
// Set an end date.
@@ -129,7 +129,7 @@ public function testCreatePromotionWithEndDate() {
129
129
130
130
/** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
131
131
$ offer_field = Promotion::load (1 )->get ('offer ' )->first ();
132
- $ this ->assertEquals ('0.10 ' , $ offer_field ->target_plugin_configuration ['amount ' ]);
132
+ $ this ->assertEquals ('0.10 ' , $ offer_field ->target_plugin_configuration ['percentage ' ]);
133
133
}
134
134
135
135
/**
@@ -142,7 +142,7 @@ public function testEditPromotion() {
142
142
'offer ' => [
143
143
'target_plugin_id ' => 'order_item_percentage_off ' ,
144
144
'target_plugin_configuration ' => [
145
- 'amount ' => '0.10 ' ,
145
+ 'percentage ' => '0.10 ' ,
146
146
],
147
147
],
148
148
'conditions ' => [
@@ -160,7 +160,7 @@ public function testEditPromotion() {
160
160
161
161
/** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
162
162
$ offer_field = $ promotion ->get ('offer ' )->first ();
163
- $ this ->assertEquals ('0.10 ' , $ offer_field ->target_plugin_configuration ['amount ' ]);
163
+ $ this ->assertEquals ('0.10 ' , $ offer_field ->target_plugin_configuration ['percentage ' ]);
164
164
165
165
$ this ->drupalGet ($ promotion ->toUrl ('edit-form ' ));
166
166
$ this ->assertSession ()->pageTextContains ('Restricted ' );
@@ -170,7 +170,7 @@ public function testEditPromotion() {
170
170
$ new_promotion_name = $ this ->randomMachineName (8 );
171
171
$ edit = [
172
172
'name[0][value] ' => $ new_promotion_name ,
173
- 'offer[0][target_plugin_configuration][order_item_percentage_off][amount ] ' => '20 ' ,
173
+ 'offer[0][target_plugin_configuration][order_item_percentage_off][percentage ] ' => '20 ' ,
174
174
];
175
175
$ this ->submitForm ($ edit , 'Save ' );
176
176
@@ -180,7 +180,7 @@ public function testEditPromotion() {
180
180
181
181
/** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
182
182
$ offer_field = $ promotion_changed ->get ('offer ' )->first ();
183
- $ this ->assertEquals ('0.20 ' , $ offer_field ->target_plugin_configuration ['amount ' ]);
183
+ $ this ->assertEquals ('0.20 ' , $ offer_field ->target_plugin_configuration ['percentage ' ]);
184
184
}
185
185
186
186
/**
0 commit comments