@@ -288,71 +288,4 @@ public function test_ensure_country_resolved_does_not_duplicate_pending_retry():
288288 $ resolver = $ this ->create_resolver ();
289289 $ this ->assertNull ( $ resolver ->ensure_country_resolved () );
290290 }
291-
292- /**
293- * GIVEN a merchant that is not connected to PayPal
294- * WHEN schedule_after_connect() runs
295- * THEN no async action is enqueued
296- */
297- public function test_schedule_after_connect_does_nothing_when_merchant_is_not_connected (): void {
298- $ this ->general_settings ->shouldReceive ( 'is_merchant_connected ' )->andReturn ( false );
299- $ this ->general_settings ->shouldNotReceive ( 'get_merchant_data ' );
300-
301- expect ( 'as_enqueue_async_action ' )->never ();
302-
303- $ resolver = $ this ->create_resolver ();
304- $ this ->assertNull ( $ resolver ->schedule_after_connect () );
305- }
306-
307- /**
308- * GIVEN a connected merchant whose country is already known
309- * WHEN schedule_after_connect() runs
310- * THEN no async action is enqueued
311- */
312- public function test_schedule_after_connect_does_nothing_when_country_already_known (): void {
313- $ this ->general_settings ->shouldReceive ( 'is_merchant_connected ' )->andReturn ( true );
314- $ this ->general_settings ->shouldReceive ( 'get_merchant_data ' )
315- ->andReturn ( $ this ->merchant_data ( 'DE ' ) );
316-
317- expect ( 'as_enqueue_async_action ' )->never ();
318-
319- $ resolver = $ this ->create_resolver ();
320- $ this ->assertNull ( $ resolver ->schedule_after_connect () );
321- }
322-
323- /**
324- * GIVEN a connected merchant with an unresolved country and no pending retry
325- * WHEN schedule_after_connect() runs
326- * THEN an immediate async action is enqueued for attempt 1
327- */
328- public function test_schedule_after_connect_enqueues_async_first_attempt_when_country_is_empty (): void {
329- $ this ->general_settings ->shouldReceive ( 'is_merchant_connected ' )->andReturn ( true );
330- $ this ->general_settings ->shouldReceive ( 'get_merchant_data ' )
331- ->andReturn ( $ this ->merchant_data ( '' ) );
332-
333- expect ( 'as_enqueue_async_action ' )->once ()->with (
334- MerchantDataResolver::RETRY_HOOK ,
335- array ( 'attempt ' => 1 )
336- );
337-
338- $ resolver = $ this ->create_resolver ();
339- $ this ->assertNull ( $ resolver ->schedule_after_connect () );
340- }
341-
342- /**
343- * GIVEN a connected merchant with an unresolved country and a retry already pending
344- * WHEN schedule_after_connect() runs
345- * THEN no duplicate async action is enqueued
346- */
347- public function test_schedule_after_connect_does_not_enqueue_when_retry_already_pending (): void {
348- $ this ->general_settings ->shouldReceive ( 'is_merchant_connected ' )->andReturn ( true );
349- $ this ->general_settings ->shouldReceive ( 'get_merchant_data ' )
350- ->andReturn ( $ this ->merchant_data ( '' ) );
351-
352- when ( 'as_next_scheduled_action ' )->justReturn ( true );
353- expect ( 'as_enqueue_async_action ' )->never ();
354-
355- $ resolver = $ this ->create_resolver ();
356- $ this ->assertNull ( $ resolver ->schedule_after_connect () );
357- }
358291}
0 commit comments