@@ -110,6 +110,8 @@ public function testPaymentCreation() {
110110 $ this ->submitForm (['payment[amount][number] ' => '100 ' ], 'Add payment ' );
111111 $ this ->assertSession ()->addressEquals ($ this ->paymentUri );
112112 $ this ->assertSession ()->pageTextContains ('Pending ' );
113+
114+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([1 ]);
113115 /** @var \Drupal\commerce_payment\Entity\PaymentInterface $payment */
114116 $ payment = Payment::load (1 );
115117 $ this ->assertEquals ($ payment ->getOrderId (), $ this ->order ->id ());
@@ -122,6 +124,8 @@ public function testPaymentCreation() {
122124 $ this ->submitForm (['payment[amount][number] ' => '100 ' , 'payment[received] ' => TRUE ], 'Add payment ' );
123125 $ this ->assertSession ()->addressEquals ($ this ->paymentUri );
124126 $ this ->assertSession ()->pageTextContains ('Completed ' );
127+
128+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([2 ]);
125129 /** @var \Drupal\commerce_payment\Entity\PaymentInterface $payment */
126130 $ payment = Payment::load (2 );
127131 $ this ->assertEquals ($ payment ->getOrderId (), $ this ->order ->id ());
@@ -147,6 +151,7 @@ public function testPaymentReceive() {
147151 $ this ->assertSession ()->pageTextNotContains ('Pending ' );
148152 $ this ->assertSession ()->pageTextContains ('Completed ' );
149153
154+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([$ payment ->id ()]);
150155 $ payment = Payment::load ($ payment ->id ());
151156 $ this ->assertEquals ($ payment ->getState ()->getLabel (), 'Completed ' );
152157 }
@@ -168,8 +173,9 @@ public function testPaymentRefund() {
168173 $ this ->assertSession ()->pageTextNotContains ('Completed ' );
169174 $ this ->assertSession ()->pageTextContains ('Refunded ' );
170175
176+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([$ payment ->id ()]);
171177 $ payment = Payment::load ($ payment ->id ());
172- $ this ->assertEquals ($ payment ->getState ()->getLabel (), ' Refunded ' );
178+ $ this ->assertEquals (' Refunded ' , $ payment ->getState ()->getLabel ());
173179 }
174180
175181 /**
@@ -188,6 +194,7 @@ public function testPaymentVoid() {
188194 $ this ->assertSession ()->addressEquals ($ this ->paymentUri );
189195 $ this ->assertSession ()->pageTextContains ('Voided ' );
190196
197+ \Drupal::entityTypeManager ()->getStorage ('commerce_payment ' )->resetCache ([$ payment ->id ()]);
191198 $ payment = Payment::load ($ payment ->id ());
192199 $ this ->assertEquals ($ payment ->getState ()->getLabel (), 'Voided ' );
193200 }
0 commit comments