changes output to a table
This commit is contained in:
@@ -90,11 +90,14 @@ class SendAcceptanceReminder extends Command
|
||||
}
|
||||
|
||||
$this->info($count.' users notified.');
|
||||
$output = "The following users do not have an email address:\n";
|
||||
$headers = ['ID', 'Name'];
|
||||
$rows = [];
|
||||
|
||||
foreach ($no_email_list as $user) {
|
||||
$output .= "ID: {$user['id']}, Name: {$user['name']}\n";
|
||||
$rows[] = [$user['id'], $user['name']];
|
||||
}
|
||||
$this->info($output);
|
||||
$this->info("The following users do not have an email address:");
|
||||
$this->table($headers, $rows);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -43,9 +43,13 @@ class SendAcceptanceReminderTest extends TestCase
|
||||
CheckoutAcceptance::factory()->pending()->create([
|
||||
'assigned_to_id' => $userA->id,
|
||||
]);
|
||||
|
||||
$headers = ['ID', 'Name'];
|
||||
$rows = [
|
||||
[$userA->id, $userA->present()->fullName()],
|
||||
];
|
||||
$this->artisan('snipeit:acceptance-reminder')
|
||||
->expectsOutput("The following users do not have an email address:\nID: {$userA->id}, Name: {$userA->present()->fullName()}\n")
|
||||
->expectsOutput("The following users do not have an email address:")
|
||||
->expectsTable($headers, $rows)
|
||||
->assertExitCode(0);
|
||||
|
||||
Mail::assertNotSent(UnacceptedAssetReminderMail::class);
|
||||
|
||||
Reference in New Issue
Block a user