also looking at this
Apply fixes from StyleCI
#2
4 files
+14
-13
| @@ -2,9 +2,8 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Cion\LaravelLogReader\Tests; |
| 4 | 4 | |
| 5 | use Cion\LaravelLogReader\Reader\Exception\FolderNotFoundException; | |
| 6 | 5 | use Cion\LaravelLogReader\Reader\LogReader; |
| 7 | use Illuminate\Support\Facades\Storage; | |
| 6 | use Cion\LaravelLogReader\Reader\Exception\FolderNotFoundException; | |
| 8 | 7 | |
| 9 | 8 | class LogReaderTest extends TestCase |
| 10 | 9 | { |
| @@ -18,7 +17,7 @@ class LogReaderTest extends TestCase | ||
| 18 | 17 | { |
| 19 | 18 | parent::setUp(); |
| 20 | 19 | |
| 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.'; | |
| 22 | 21 | |
| 23 | 22 | $this->logReader = new LogReader(); |
| 24 | 23 | } |
| @@ -41,7 +40,7 @@ class LogReaderTest extends TestCase | ||
| 41 | 40 | { |
| 42 | 41 | $this->createLogFolder(function () { |
| 43 | 42 | 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); | |
| 45 | 44 | } |
| 46 | 45 | |
| 47 | 46 | $this->assertCount(5, $this->logReader->all()->get()); |
| @@ -52,7 +51,7 @@ class LogReaderTest extends TestCase | ||
| 52 | 51 | public function it_can_get_today_log_files() |
| 53 | 52 | { |
| 54 | 53 | $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); | |
| 56 | 55 | $this->assertCount(1, $this->logReader->get()); |
| 57 | 56 | }); |
| 58 | 57 | } |
| @@ -61,7 +60,7 @@ class LogReaderTest extends TestCase | ||
| 61 | 60 | public function it_can_get_yesterday_log_files() |
| 62 | 61 | { |
| 63 | 62 | $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); | |
| 65 | 64 | |
| 66 | 65 | $this->assertCount(1, $this->logReader->yesterday()->get()); |
| 67 | 66 | }); |
| @@ -74,13 +73,13 @@ class LogReaderTest extends TestCase | ||
| 74 | 73 | $this->filesystem->makeDirectory("{$this->directory}/loggers_1"); |
| 75 | 74 | |
| 76 | 75 | 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); | |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | $this->filesystem->makeDirectory("{$this->directory}/loggers_2"); |
| 81 | 80 | |
| 82 | 81 | 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); | |
| 84 | 83 | } |
| 85 | 84 | |
| 86 | 85 | $this->assertCount(10, $this->logReader->all()->get()); |
| @@ -92,7 +91,7 @@ class LogReaderTest extends TestCase | ||
| 92 | 91 | { |
| 93 | 92 | $this->expectException(FolderNotFoundException::class); |
| 94 | 93 | |
| 95 | $this->app['config']->set('logreader.path', "fakeDirectory"); | |
| 94 | $this->app['config']->set('logreader.path', 'fakeDirectory'); | |
| 96 | 95 | |
| 97 | 96 | $this->assertCount(1, $this->logReader->all()->get()); |
| 98 | 97 | } |