@@ -50,13 +50,13 @@ public function testCreatePromotion() {
5050 $ this ->getSession ()->getPage ()->fillField ('name[0][value] ' , $ name );
5151 $ this ->getSession ()->getPage ()->selectFieldOption ('offer[0][target_plugin_id] ' , 'order_item_percentage_off ' );
5252 $ 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 ' );
5454
5555 // Change, assert any values reset.
5656 $ this ->getSession ()->getPage ()->selectFieldOption ('offer[0][target_plugin_id] ' , 'order_percentage_off ' );
5757 $ 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 ' );
6060
6161 // Confirm the integrity of the conditions UI.
6262 foreach (['order ' , 'product ' , 'customer ' ] as $ condition_group ) {
@@ -86,7 +86,7 @@ public function testCreatePromotion() {
8686 $ promotion = Promotion::load (1 );
8787 /** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
8888 $ 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 ' ]);
9090
9191 /** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $condition_field */
9292 $ condition_field = $ promotion ->get ('conditions ' )->first ();
@@ -115,7 +115,7 @@ public function testCreatePromotionWithEndDate() {
115115 $ name = $ this ->randomMachineName (8 );
116116 $ edit = [
117117 '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 ' ,
119119 ];
120120
121121 // Set an end date.
@@ -129,7 +129,7 @@ public function testCreatePromotionWithEndDate() {
129129
130130 /** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
131131 $ 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 ' ]);
133133 }
134134
135135 /**
@@ -142,7 +142,7 @@ public function testEditPromotion() {
142142 'offer ' => [
143143 'target_plugin_id ' => 'order_item_percentage_off ' ,
144144 'target_plugin_configuration ' => [
145- 'amount ' => '0.10 ' ,
145+ 'percentage ' => '0.10 ' ,
146146 ],
147147 ],
148148 'conditions ' => [
@@ -160,7 +160,7 @@ public function testEditPromotion() {
160160
161161 /** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
162162 $ 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 ' ]);
164164
165165 $ this ->drupalGet ($ promotion ->toUrl ('edit-form ' ));
166166 $ this ->assertSession ()->pageTextContains ('Restricted ' );
@@ -170,7 +170,7 @@ public function testEditPromotion() {
170170 $ new_promotion_name = $ this ->randomMachineName (8 );
171171 $ edit = [
172172 '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 ' ,
174174 ];
175175 $ this ->submitForm ($ edit , 'Save ' );
176176
@@ -180,7 +180,7 @@ public function testEditPromotion() {
180180
181181 /** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
182182 $ 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 ' ]);
184184 }
185185
186186 /**
0 commit comments