Skip to content

A free open source IT asset/license management system

changes output to a table

Godfrey M899119ae2dca
diff --git a/app/Console/Commands/SendAcceptanceReminder.php b/app/Console/Commands/SendAcceptanceReminder.php
index 199bd07ed7..89a5b6167a 100644
--- a/app/Console/Commands/SendAcceptanceReminder.php
+++ b/app/Console/Commands/SendAcceptanceReminder.php
@@ -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;
}
diff --git a/tests/Feature/Console/SendAcceptanceReminderTest.php b/tests/Feature/Console/SendAcceptanceReminderTest.php
index 7c49f81cb4..ee28e09355 100644
--- a/tests/Feature/Console/SendAcceptanceReminderTest.php
+++ b/tests/Feature/Console/SendAcceptanceReminderTest.php
@@ -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);