Skip to content

Commit

Permalink
test with only one file
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Peterson committed Dec 5, 2017
1 parent 8b370c7 commit 96a7edc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/ClearLogsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ public function test_it_should_keep_the_last_log_file_if_the_option_is_provided(
}
}

public function test_it_should_keep_the_last_log_file_if_the_option_is_with_only_one_file()
{
touch($this->logDirectory . '/file1.log', time() - 3600);

if (! $this->artisan('log:clear', ['--keep-last' => true])) {
$this->assertFileExists($this->logDirectory . '/file1.log');
} else {
$this->assertTrue(false, 'this test failed...');
}
}

public function test_it_should_return_zero_even_if_there_is_no_log_file()
{
$this->assertEquals(0, $this->artisan('log:clear'));
Expand Down

0 comments on commit 96a7edc

Please sign in to comment.