Skip to content

Commit

Permalink
Update to support laravel 5.8 (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc authored Feb 27, 2019
1 parent bc5ff72 commit 3cb039a
Show file tree
Hide file tree
Showing 24 changed files with 66 additions and 83 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2017 ARCANEDEV <[email protected]> - LogViewer
Copyright (c) 2015-2019 ARCANEDEV <[email protected]> - LogViewer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/LogViewer/rel
## Features

- A great Log viewer API.
- Laravel `5.0` to `5.7` are supported.
- Laravel `5.0` to `5.8` are supported.
- Ready to use (Views, Routes, controllers &hellip; Out of the box) [Note: No need to publish assets]
- View, paginate, filter, download and delete logs.
- Load a custom logs storage path.
Expand Down
2 changes: 1 addition & 1 deletion _docs/0.Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This package allows you to keep track of each one of your logs stored under `sto
## Features

- A great Log viewer API.
- Laravel `5.0` to `5.7` are supported.
- Laravel `5.0` to `5.8` are supported.
- Ready to use (Views, Routes, controllers &hellip; Out of the box) [Note: No need to publish assets]
- View, paginate, filter, download and delete logs.
- Load a custom logs storage path.
Expand Down
3 changes: 3 additions & 0 deletions _docs/1.Installation-and-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Laravel uses the [Monolog PHP logging library](https://github.com/Seldaek/monolo
| ![LogViewer v4.4.x][log_viewer_4_4_x] | ![Laravel v5.5][laravel_5_5] |
| ![LogViewer v4.5.x][log_viewer_4_5_x] | ![Laravel v5.6][laravel_5_6] |
| ![LogViewer v4.6.x][log_viewer_4_6_x] | ![Laravel v5.7][laravel_5_7] |
| ![LogViewer v4.7.x][log_viewer_4_7_x] | ![Laravel v5.8][laravel_5_8] |

[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
Expand All @@ -37,12 +38,14 @@ Laravel uses the [Monolog PHP logging library](https://github.com/Seldaek/monolo
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"

[log_viewer_4_2_x]: https://img.shields.io/badge/version-4.2.*-blue.svg?style=flat-square "LogViewer v4.2.*"
[log_viewer_4_3_x]: https://img.shields.io/badge/version-4.3.*-blue.svg?style=flat-square "LogViewer v4.3.*"
[log_viewer_4_4_x]: https://img.shields.io/badge/version-4.4.*-blue.svg?style=flat-square "LogViewer v4.4.*"
[log_viewer_4_5_x]: https://img.shields.io/badge/version-4.5.*-blue.svg?style=flat-square "LogViewer v4.5.*"
[log_viewer_4_6_x]: https://img.shields.io/badge/version-4.6.*-blue.svg?style=flat-square "LogViewer v4.6.*"
[log_viewer_4_7_x]: https://img.shields.io/badge/version-4.7.*-blue.svg?style=flat-square "LogViewer v4.7.*"

## Composer

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"require": {
"php": ">=7.1.3",
"psr/log": "~1.0",
"arcanedev/support": "~4.4.0"
"arcanedev/support": "~4.5.0"
},
"require-dev": {
"orchestra/testbench": "~3.7.0",
"orchestra/testbench": "~3.8.0",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~7.0",
"phpunit/phpcov": "~5.0"
"phpunit/phpcov": "~5.0|~6.0",
"phpunit/phpunit": "~7.0|~8.0"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 2 additions & 5 deletions tests/Commands/ClearCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php namespace Arcanedev\LogViewer\Tests\Commands;

use Mockery;
use Arcanedev\LogViewer\Tests\TestCase;
use Arcanedev\LogViewer\Contracts\LogViewer;
use Arcanedev\LogViewer\Commands\ClearCommand;

/**
* Class ClearCommandTest
Expand All @@ -29,7 +26,7 @@ class ClearCommandTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand All @@ -39,7 +36,7 @@ protected function setUp()
$this->setupForTests();
}

protected function tearDown()
protected function tearDown(): void
{
rmdir($this->path);
unset($this->path);
Expand Down
9 changes: 1 addition & 8 deletions tests/Commands/PublishCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ class PublishCommandTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
{
parent::setUp();

//
}

protected function tearDown()
protected function tearDown(): void
{
$this->deleteConfig();
$this->deleteLocalizations();
Expand Down
24 changes: 10 additions & 14 deletions tests/Entities/LogCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class LogCollectionTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->logs = LogCollection::make();
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->logs);

Expand Down Expand Up @@ -166,25 +166,21 @@ public function it_can_get_log_menu()
}
}

/**
* @test
*
* @expectedException \Arcanedev\LogViewer\Exceptions\LogNotFoundException
* @expectedExceptionMessage Log not found in this date [2222-01-01]
*/
/** @test */
public function it_must_throw_a_log_not_found_on_get_method()
{
$this->expectException(\Arcanedev\LogViewer\Exceptions\LogNotFoundException::class);
$this->expectExceptionMessage('Log not found in this date [2222-01-01]');

$this->logs->get('2222-01-01');
}

/**
* @test
*
* @expectedException \Arcanedev\LogViewer\Exceptions\LogNotFoundException
* @expectedExceptionMessage Log not found in this date [2222-01-01]
*/
/** @test */
public function it_must_throw_a_log_not_found_on_log_method()
{
$this->expectException(\Arcanedev\LogViewer\Exceptions\LogNotFoundException::class);
$this->expectExceptionMessage('Log not found in this date [2222-01-01]');

$this->logs->log('2222-01-01');
}
}
4 changes: 2 additions & 2 deletions tests/Entities/LogEntryCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class LogEntryCollectionTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->entries = new LogEntryCollection;
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->entries);

Expand Down
4 changes: 2 additions & 2 deletions tests/Entities/LogEntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class LogEntryTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->entry = $this->getRandomLogEntry('2015-01-01');
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->entry);

Expand Down
4 changes: 2 additions & 2 deletions tests/Entities/LogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class LogTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->log = $this->getLog('2015-01-01');
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->log);

Expand Down
4 changes: 2 additions & 2 deletions tests/LogViewerServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class LogViewerServiceProviderTest extends TestCase
| -----------------------------------------------------------------
*/

public function setUp()
public function setUp(): void
{
parent::setUp();

$this->provider = $this->app->getProvider(LogViewerServiceProvider::class);
}

public function tearDown()
public function tearDown(): void
{
unset($this->provider);

Expand Down
4 changes: 2 additions & 2 deletions tests/LogViewerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class LogViewerTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->logViewer = $this->app->make(\Arcanedev\LogViewer\Contracts\LogViewer::class);
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->logViewer);

Expand Down
4 changes: 2 additions & 2 deletions tests/Providers/CommandsServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class CommandsServiceProviderTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->provider = $this->app->getProvider(CommandsServiceProvider::class);
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->provider);

Expand Down
4 changes: 2 additions & 2 deletions tests/Providers/UtilitiesServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class UtilitiesServiceProviderTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->provider = $this->app->getProvider(UtilitiesServiceProvider::class);
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->provider);

Expand Down
8 changes: 4 additions & 4 deletions tests/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function it_can_see_dashboard_page()
$response = $this->get(route('log-viewer::dashboard'));
$response->assertSuccessful();

static::assertContains(
static::assertStringContainsString(
'<h1>Dashboard</h1>',
$response->getContent()
);
Expand All @@ -33,7 +33,7 @@ public function it_can_see_logs_page()
$response = $this->get(route('log-viewer::logs.list'));
$response->assertSuccessful();

static::assertContains(
static::assertStringContainsString(
'<h1>Logs</h1>',
$response->getContent()
);
Expand All @@ -48,7 +48,7 @@ public function it_can_show_a_log_page()
$response = $this->get(route('log-viewer::logs.show', [$date]));
$response->assertSuccessful();

static::assertContains(
static::assertStringContainsString(
"<h1>Log [{$date}]</h1>",
$response->getContent()
);
Expand All @@ -64,7 +64,7 @@ public function it_can_see_a_filtered_log_entries_page()
$response = $this->get(route('log-viewer::logs.filter', [$date, $level]));
$response->assertSuccessful();

static::assertContains(
static::assertStringContainsString(
"<h1>Log [{$date}]</h1>",
$response->getContent()
);
Expand Down
4 changes: 2 additions & 2 deletions tests/Tables/StatsTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class StatsTableTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand All @@ -38,7 +38,7 @@ protected function setUp()
);
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->table);

Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ abstract class TestCase extends BaseTestCase
| -----------------------------------------------------------------
*/

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();

static::$logLevels = self::getLogLevels();
}

public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();

Expand Down
12 changes: 5 additions & 7 deletions tests/Utilities/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class FactoryTest extends TestCase
| -----------------------------------------------------------------
*/

protected function setUp()
protected function setUp(): void
{
parent::setUp();

$this->logFactory = $this->app->make(\Arcanedev\LogViewer\Contracts\Utilities\Factory::class);
}

protected function tearDown()
protected function tearDown(): void
{
unset($this->logFactory);

Expand Down Expand Up @@ -225,13 +225,11 @@ public function it_can_check_is_not_empty()
static::assertFalse($this->logFactory->isEmpty());
}

/**
* @test
*
* @expectedException \Arcanedev\LogViewer\Exceptions\LogNotFoundException
*/
/** @test */
public function it_must_throw_a_filesystem_exception()
{
$this->expectException(\Arcanedev\LogViewer\Exceptions\LogNotFoundException::class);

$this->logFactory->get('2222-11-11'); // Future FTW
}

Expand Down
Loading

0 comments on commit 3cb039a

Please sign in to comment.