@@ -20,7 +20,7 @@ class HandleCustomerSubscriptionCreatedJobTest extends TestCase
2020 use RefreshDatabase;
2121
2222 /** @test */
23- public function it_dispatches_the_create_anystack_license_job_with_correct_data ()
23+ public function it_does_not_dispatch_create_anystack_license_job ()
2424 {
2525 $ this ->createTestData ('John Doe ' );
2626
@@ -31,48 +31,7 @@ public function it_dispatches_the_create_anystack_license_job_with_correct_data(
3131 $ job = new HandleCustomerSubscriptionCreatedJob ($ webhookCall );
3232 $ job ->handle ();
3333
34- Bus::assertDispatched (CreateAnystackLicenseJob::class, function (CreateAnystackLicenseJob $ job ) {
35- return $ job ->user instanceof User &&
36- $ job ->user ->email === 'test@example.com ' &&
37- $ job ->subscription === Subscription::Max &&
38- $ job ->firstName === 'John ' &&
39- $ job ->lastName === 'Doe ' ;
40- });
41- }
42-
43- /**
44- * @dataProvider customerNameProvider
45- *
46- * @test
47- */
48- public function it_extracts_customer_name_parts_correctly ($ fullName , $ expectedFirstName , $ expectedLastName )
49- {
50- $ this ->createTestData ($ fullName );
51-
52- $ webhookCall = new WebhookHandled ($ this ->getTestWebhookPayload ());
53-
54- Bus::fake ();
55-
56- $ job = new HandleCustomerSubscriptionCreatedJob ($ webhookCall );
57- $ job ->handle ();
58-
59- Bus::assertDispatched (CreateAnystackLicenseJob::class, function ($ job ) use ($ expectedFirstName , $ expectedLastName ) {
60- return $ job ->firstName === $ expectedFirstName &&
61- $ job ->lastName === $ expectedLastName ;
62- });
63- }
64-
65- /**
66- * Data provider for customer name tests
67- */
68- public static function customerNameProvider ()
69- {
70- return [
71- 'Full name ' => ['John Doe ' , 'John ' , 'Doe ' ],
72- 'First name only ' => ['Jane ' , 'Jane ' , null ],
73- 'Empty string ' => ['' , null , null ],
74- 'Null value ' => [null , null , null ],
75- ];
34+ Bus::assertNotDispatched (CreateAnystackLicenseJob::class);
7635 }
7736
7837 /** @test */
0 commit comments