ReviewOS

also looking at this

ci-on/laravel-log-reader

Apply fixes from StyleCI

#2
Merged simoebenhida wants to merge analysis-XlAwk9 into master
4 files +14 -13
tests/LogReaderTest.phpmodified+8-9
Changes to tests/LogReaderTest.php
@@ -2,9 +2,8 @@
22
33namespace Cion\LaravelLogReader\Tests;
44
5use Cion\LaravelLogReader\Reader\Exception\FolderNotFoundException;
65use Cion\LaravelLogReader\Reader\LogReader;
7use Illuminate\Support\Facades\Storage;
6use Cion\LaravelLogReader\Reader\Exception\FolderNotFoundException;
87
98class LogReaderTest extends TestCase
109{
@@ -18,7 +17,7 @@ class LogReaderTest extends TestCase
1817 {
1918 parent::setUp();
2019
21 $this->exampleLogLine = "[2019-03-10 20:40:52] local.ERROR: An informational message.";
20 $this->exampleLogLine = '[2019-03-10 20:40:52] local.ERROR: An informational message.';
2221
2322 $this->logReader = new LogReader();
2423 }
@@ -41,7 +40,7 @@ class LogReaderTest extends TestCase
4140 {
4241 $this->createLogFolder(function () {
4342 foreach (range(0, 4) as $loop) {
44 $this->filesystem->put("{$this->directory}/laravel-".now()->addDays($loop)->format('Y-m-d').".log", $this->exampleLogLine);
43 $this->filesystem->put("{$this->directory}/laravel-".now()->addDays($loop)->format('Y-m-d').'.log', $this->exampleLogLine);
4544 }
4645
4746 $this->assertCount(5, $this->logReader->all()->get());
@@ -52,7 +51,7 @@ class LogReaderTest extends TestCase
5251 public function it_can_get_today_log_files()
5352 {
5453 $this->createLogFolder(function () {
55 $this->filesystem->put("{$this->directory}/laravel-".now()->format('Y-m-d').".log", $this->exampleLogLine);
54 $this->filesystem->put("{$this->directory}/laravel-".now()->format('Y-m-d').'.log', $this->exampleLogLine);
5655 $this->assertCount(1, $this->logReader->get());
5756 });
5857 }
@@ -61,7 +60,7 @@ class LogReaderTest extends TestCase
6160 public function it_can_get_yesterday_log_files()
6261 {
6362 $this->createLogFolder(function () {
64 $this->filesystem->put("{$this->directory}/laravel-".now()->yesterday()->format('Y-m-d').".log", $this->exampleLogLine);
63 $this->filesystem->put("{$this->directory}/laravel-".now()->yesterday()->format('Y-m-d').'.log', $this->exampleLogLine);
6564
6665 $this->assertCount(1, $this->logReader->yesterday()->get());
6766 });
@@ -74,13 +73,13 @@ class LogReaderTest extends TestCase
7473 $this->filesystem->makeDirectory("{$this->directory}/loggers_1");
7574
7675 foreach (range(0, 4) as $loop) {
77 $this->filesystem->put("{$this->directory}/loggers_1/laravel-".now()->addDays($loop)->format('Y-m-d').".log", $this->exampleLogLine);
76 $this->filesystem->put("{$this->directory}/loggers_1/laravel-".now()->addDays($loop)->format('Y-m-d').'.log', $this->exampleLogLine);
7877 }
7978
8079 $this->filesystem->makeDirectory("{$this->directory}/loggers_2");
8180
8281 foreach (range(0, 4) as $loop) {
83 $this->filesystem->put("{$this->directory}/loggers_2/laravel-".now()->addDays($loop)->format('Y-m-d').".log", $this->exampleLogLine);
82 $this->filesystem->put("{$this->directory}/loggers_2/laravel-".now()->addDays($loop)->format('Y-m-d').'.log', $this->exampleLogLine);
8483 }
8584
8685 $this->assertCount(10, $this->logReader->all()->get());
@@ -92,7 +91,7 @@ class LogReaderTest extends TestCase
9291 {
9392 $this->expectException(FolderNotFoundException::class);
9493
95 $this->app['config']->set('logreader.path', "fakeDirectory");
94 $this->app['config']->set('logreader.path', 'fakeDirectory');
9695
9796 $this->assertCount(1, $this->logReader->all()->get());
9897 }