22
33namespace Tests \Feature \Models \User ;
44
5+ use App \Library \Stripe \Rules \Amount \Other ;
56use App \Models \AdmissionTest ;
67use App \Models \NationalMensa ;
8+ use App \Models \OtherPaymentGateway ;
79use App \Models \QualifyingTest ;
810use App \Models \User ;
911use Illuminate \Foundation \Testing \RefreshDatabase ;
@@ -76,6 +78,8 @@ public function test_user_can_edit_passport_information_when_user_only_has_in_pr
7678 'status ' => 'pending ' ,
7779 'expired_at ' => now ()->addHour (),
7880 'price ' => 400 ,
81+ 'gateway_type ' => OtherPaymentGateway::class,
82+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
7983 ]);
8084
8185 $ this ->assertTrue ($ this ->user ->canEditPassportInformation );
@@ -87,6 +91,8 @@ public function test_user_can_edit_passport_information_when_user_only_has_expir
8791 'status ' => fake ()->randomElement (['pending ' , 'canceled ' , 'failed ' ]),
8892 'expired_at ' => now ()->subSecond (),
8993 'price ' => 400 ,
94+ 'gateway_type ' => OtherPaymentGateway::class,
95+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
9096 ]);
9197
9298 $ this ->assertTrue ($ this ->user ->canEditPassportInformation );
@@ -98,6 +104,8 @@ public function test_user_cannot_edit_passport_information_when_user_has_prior_e
98104 'status ' => 'succeeded ' ,
99105 'expired_at ' => now ()->addHour (),
100106 'price ' => 400 ,
107+ 'gateway_type ' => OtherPaymentGateway::class,
108+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
101109 ]);
102110
103111 $ this ->assertFalse ($ this ->user ->canEditPassportInformation );
@@ -110,6 +118,8 @@ public function test_user_can_edit_passport_information_when_user_has_prior_evid
110118 'expired_at ' => now ()->subSecond (),
111119 'is_returned ' => true ,
112120 'price ' => 400 ,
121+ 'gateway_type ' => OtherPaymentGateway::class,
122+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
113123 ]);
114124
115125 $ this ->assertTrue ($ this ->user ->canEditPassportInformation );
@@ -121,6 +131,8 @@ public function test_user_cannot_edit_passport_information_when_user_has_prior_e
121131 'status ' => 'succeeded ' ,
122132 'expired_at ' => now ()->subSecond (),
123133 'price ' => 400 ,
134+ 'gateway_type ' => OtherPaymentGateway::class,
135+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
124136 ]);
125137
126138 $ order ->result ()->create ([
@@ -140,6 +152,8 @@ public function test_user_can_edit_passport_information_when_user_has_prior_evid
140152 'expired_at ' => now ()->subSecond (),
141153 'is_returned ' => true ,
142154 'price ' => 400 ,
155+ 'gateway_type ' => OtherPaymentGateway::class,
156+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
143157 ]);
144158
145159 $ order ->result ()->create ([
@@ -158,6 +172,8 @@ public function test_user_can_edit_passport_information_when_user_only_has_rejec
158172 'status ' => 'succeeded ' ,
159173 'expired_at ' => now ()->subSecond (),
160174 'price ' => 400 ,
175+ 'gateway_type ' => OtherPaymentGateway::class,
176+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
161177 ]);
162178
163179 $ order ->result ()->create ([
@@ -177,6 +193,8 @@ public function test_user_cannot_edit_passport_information_when_user_only_has_ac
177193 'status ' => 'succeeded ' ,
178194 'expired_at ' => now ()->subSecond (),
179195 'price ' => 400 ,
196+ 'gateway_type ' => OtherPaymentGateway::class,
197+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
180198 ]);
181199
182200 $ order ->result ()->create ([
@@ -197,6 +215,8 @@ public function test_user_can_edit_passport_information_when_user_only_has_accep
197215 'expired_at ' => now ()->subSecond (),
198216 'is_returned ' => true ,
199217 'price ' => 400 ,
218+ 'gateway_type ' => OtherPaymentGateway::class,
219+ 'gateway_id ' => OtherPaymentGateway::inRandomOrder ()->first ()->id ,
200220 ]);
201221
202222 $ order ->result ()->create ([
0 commit comments