Skip to content

Commit d2f5634

Browse files
committed
Replace assertExitCode(0) with assertSuccessful() in tests
Updated EmulatedImportTest to use assertSuccessful() instead of assertExitCode(0) for better readability and alignment with Laravel's testing conventions.
1 parent 0478a22 commit d2f5634

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/Feature/Emulator/EmulatedImportTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function test_ldap_users_are_imported()
4848
'provider' => 'ldap-database',
4949
'--attributes' => 'cn,mail,objectguid',
5050
'--no-interaction',
51-
])->assertExitCode(0);
51+
])->assertSuccessful();
5252

5353
$imported = TestUserModelStub::get();
5454

@@ -74,7 +74,7 @@ public function test_import_fails_when_required_attributes_are_missing()
7474
$this->artisan('ldap:import', [
7575
'provider' => 'ldap-database',
7676
'--no-interaction',
77-
])->assertExitCode(0);
77+
])->assertSuccessful();
7878

7979
Event::assertDispatched(ImportFailed::class);
8080
}
@@ -92,7 +92,7 @@ public function test_disabled_users_are_soft_deleted_when_flag_is_set()
9292
'provider' => 'ldap-database',
9393
'--no-interaction',
9494
'--delete' => true,
95-
])->assertExitCode(0);
95+
])->assertSuccessful();
9696

9797
$created = TestUserModelStub::withTrashed()->first();
9898

@@ -123,7 +123,7 @@ public function test_enabled_users_who_are_soft_deleted_are_restored_when_flag_i
123123
'--no-interaction',
124124
'--delete' => true,
125125
'--restore' => true,
126-
])->assertExitCode(0);
126+
])->assertSuccessful();
127127

128128
$this->assertFalse($database->fresh()->trashed());
129129
}
@@ -180,7 +180,7 @@ public function test_missing_users_are_soft_deleted_when_flag_is_enabled()
180180
'provider' => 'ldap-database',
181181
'--no-interaction',
182182
'--delete-missing',
183-
])->assertExitCode(0);
183+
])->assertSuccessful();
184184

185185
$this->assertFalse($missingLdapUser->fresh()->trashed());
186186

@@ -193,7 +193,7 @@ public function test_missing_users_are_soft_deleted_when_flag_is_enabled()
193193
'provider' => 'ldap-database',
194194
'--no-interaction',
195195
'--delete-missing' => true,
196-
])->assertExitCode(0);
196+
])->assertSuccessful();
197197

198198
Event::assertDispatched(DeletedMissing::class, function (DeletedMissing $event) use ($missingLdapUser) {
199199
return $event->deleted->count() == 1
@@ -236,7 +236,7 @@ public function test_existing_users_are_synchronized_when_enabled()
236236
$this->artisan('ldap:import', [
237237
'provider' => 'ldap-database',
238238
'--no-interaction',
239-
])->assertExitCode(0);
239+
])->assertSuccessful();
240240

241241
$database->refresh();
242242

@@ -274,7 +274,7 @@ public function test_can_use_array_syntax_for_sync_existing_configuration()
274274
$this->artisan('ldap:import', [
275275
'provider' => 'ldap-database',
276276
'--no-interaction',
277-
])->assertExitCode(0);
277+
])->assertSuccessful();
278278

279279
$database->refresh();
280280

@@ -308,7 +308,7 @@ public function test_existing_users_can_be_synchronized_using_raw_attributes()
308308
$this->artisan('ldap:import', [
309309
'provider' => 'ldap-database',
310310
'--no-interaction',
311-
])->assertExitCode(0);
311+
])->assertSuccessful();
312312

313313
$database->refresh();
314314

@@ -341,7 +341,7 @@ public function test_scopes_can_be_applied_to_command()
341341
'provider' => 'ldap-database',
342342
'--scopes' => TestImportUserModelScope::class,
343343
'--no-interaction',
344-
])->assertExitCode(0);
344+
])->assertSuccessful();
345345

346346
$this->assertCount(1, $users = TestUserModelStub::get());
347347
$this->assertEquals('Bar', $users->first()->name);

0 commit comments

Comments
 (0)