@@ -110,6 +110,8 @@ public function testPaymentCreation() {
110
110
$ this ->submitForm (['payment[amount][number] ' => '100 ' ], 'Add payment ' );
111
111
$ this ->assertSession ()->addressEquals ($ this ->paymentUri );
112
112
$ this ->assertSession ()->pageTextContains ('Pending ' );
113
+
114
+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([1 ]);
113
115
/** @var \Drupal\commerce_payment\Entity\PaymentInterface $payment */
114
116
$ payment = Payment::load (1 );
115
117
$ this ->assertEquals ($ payment ->getOrderId (), $ this ->order ->id ());
@@ -122,6 +124,8 @@ public function testPaymentCreation() {
122
124
$ this ->submitForm (['payment[amount][number] ' => '100 ' , 'payment[received] ' => TRUE ], 'Add payment ' );
123
125
$ this ->assertSession ()->addressEquals ($ this ->paymentUri );
124
126
$ this ->assertSession ()->pageTextContains ('Completed ' );
127
+
128
+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([2 ]);
125
129
/** @var \Drupal\commerce_payment\Entity\PaymentInterface $payment */
126
130
$ payment = Payment::load (2 );
127
131
$ this ->assertEquals ($ payment ->getOrderId (), $ this ->order ->id ());
@@ -147,6 +151,7 @@ public function testPaymentReceive() {
147
151
$ this ->assertSession ()->pageTextNotContains ('Pending ' );
148
152
$ this ->assertSession ()->pageTextContains ('Completed ' );
149
153
154
+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([$ payment ->id ()]);
150
155
$ payment = Payment::load ($ payment ->id ());
151
156
$ this ->assertEquals ($ payment ->getState ()->getLabel (), 'Completed ' );
152
157
}
@@ -168,8 +173,9 @@ public function testPaymentRefund() {
168
173
$ this ->assertSession ()->pageTextNotContains ('Completed ' );
169
174
$ this ->assertSession ()->pageTextContains ('Refunded ' );
170
175
176
+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([$ payment ->id ()]);
171
177
$ payment = Payment::load ($ payment ->id ());
172
- $ this ->assertEquals ($ payment ->getState ()->getLabel (), ' Refunded ' );
178
+ $ this ->assertEquals (' Refunded ' , $ payment ->getState ()->getLabel ());
173
179
}
174
180
175
181
/**
@@ -188,6 +194,7 @@ public function testPaymentVoid() {
188
194
$ this ->assertSession ()->addressEquals ($ this ->paymentUri );
189
195
$ this ->assertSession ()->pageTextContains ('Voided ' );
190
196
197
+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([$ payment ->id ()]);
191
198
$ payment = Payment::load ($ payment ->id ());
192
199
$ this ->assertEquals ($ payment ->getState ()->getLabel (), 'Voided ' );
193
200
}
0 commit comments