Skip to content

Commit ce5d153

Browse files
committed
ICL: Minor fixes in tests.
1 parent 81523bd commit ce5d153

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

tests/Loggable/FileChannel/FileChannelTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ class FileChannelTest extends TestCase
77
/** @test */
88
public function it_creates_log_file_according_to_the_command_name_and_current_date()
99
{
10-
Artisan::call('generic');
10+
$this->artisan('generic');
1111

1212
$this->assertLogFileExists("generic/{$this->date}.log");
1313
}
1414

1515
/** @test */
1616
public function it_creates_log_file_in_subfolder_if_command_is_namespaced()
1717
{
18-
Artisan::call('namespaced:command');
18+
$this->artisan('namespaced:command');
1919

2020
$this->assertLogFileExists("namespaced/command/{$this->date}.log");
2121
}
@@ -35,7 +35,7 @@ public function it_provides_automatic_file_rotation_and_only_30_latest_files_are
3535
/** @test */
3636
public function it_supports_separator_in_psr3_methods_which_is_transformed_to_11_blank_lines()
3737
{
38-
Artisan::call('separator-logging-command');
38+
$this->artisan('separator-logging-command');
3939

4040
$this->assertLogFileContains("separator-logging-command/{$this->date}.log", [
4141
'Testing separator!',

tests/Loggable/Notifications/DatabaseChannel/DatabaseChannelTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ class DatabaseChannelTest extends TestCase
99
/** @test */
1010
public function it_is_not_storing_notifications_to_database_if_it_is_disabled()
1111
{
12-
Artisan::call('database-notifications-disabled-command');
12+
$this->artisan('database-notifications-disabled-command');
1313

1414
$this->assertFalse(Schema::hasTable('iclogger_notifications'));
1515
}
1616

1717
/** @test */
1818
public function it_stores_notifications_to_database_if_it_is_enabled_and_also_according_to_notifications_level()
1919
{
20-
Artisan::call('database-notifications-command');
20+
$this->artisan('database-notifications-command');
2121

2222
$this->notSeeInDatabaseMany('iclogger_notifications', [
2323
['level' => Logger::DEBUG],
@@ -74,7 +74,7 @@ public function it_provides_an_ability_to_use_custom_database_table_and_callback
7474
$table->index('created_at');
7575
});
7676

77-
Artisan::call('database-notifications-callback-command');
77+
$this->artisan('database-notifications-callback-command');
7878

7979
$this->notSeeInDatabaseMany('custom_notifications', [
8080
['level' => Logger::DEBUG],

tests/LoggableTraitOnMysqlTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function it_writes_to_log_file_information_header_each_iteration()
2323
$host = gethostname();
2424
$ip = gethostbyname($host);
2525

26-
Artisan::call('generic');
26+
$this->artisan('generic');
2727

2828
$this->assertLogFileContains("generic/{$this->date}.log", [
2929
"[%datetime%]: [INFO]: Command `{$class}` initialized.",
@@ -38,7 +38,7 @@ public function it_writes_to_log_file_mysql_specific_information_after_header()
3838
$dbHost = (string) db_mysql_variable('hostname');
3939
$dbPort = (string) db_mysql_variable('port');
4040

41-
Artisan::call('generic');
41+
$this->artisan('generic');
4242

4343
$this->assertLogFileContains("generic/{$this->date}.log", [
4444
"[%datetime%]: [INFO]: Database host: `{$dbHost}`, port: `{$dbPort}`, ip: `{$dbIp}`.",

tests/LoggableTraitTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function it_writes_to_log_file_information_header_each_iteration()
1313
$host = gethostname();
1414
$ip = gethostbyname($host);
1515

16-
Artisan::call('generic');
16+
$this->artisan('generic');
1717

1818
$this->assertLogFileContains("generic/{$this->date}.log", [
1919
"[%datetime%]: [INFO]: Command `{$class}` initialized.",
@@ -24,7 +24,7 @@ public function it_writes_to_log_file_information_header_each_iteration()
2424
/** @test */
2525
public function it_does_not_write_mysql_specific_information_for_non_mysql_connections()
2626
{
27-
Artisan::call('generic');
27+
$this->artisan('generic');
2828

2929
$this->assertLogFileNotContains("generic/{$this->date}.log", [
3030
'Database host:',
@@ -53,7 +53,7 @@ public function it_writes_to_log_file_information_footer_each_iteration()
5353
/** @test */
5454
public function it_supports_psr3_methods_for_logging()
5555
{
56-
Artisan::call('generic');
56+
$this->artisan('generic');
5757

5858
$this->assertLogFileContains("generic/{$this->date}.log", [
5959
'[%datetime%]: [DEBUG]: Debug!',
@@ -70,7 +70,7 @@ public function it_supports_psr3_methods_for_logging()
7070
/** @test */
7171
public function psr3_methods_are_supporting_context_and_it_is_logged_as_readable_dump()
7272
{
73-
Artisan::call('context-logging-command');
73+
$this->artisan('context-logging-command');
7474

7575
$this->assertLogFileContains("context-logging-command/{$this->date}.log", [
7676
'Testing context!',

0 commit comments

Comments
 (0)