Skip to content

Commit

Permalink
Merge pull request #166 from ARCANEDEV/develop
Browse files Browse the repository at this point in the history
Updating the package for Laravel 5.5
  • Loading branch information
arcanedev-maroc authored Aug 31, 2017
2 parents a161d8b + d581e13 commit 5aacb3d
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 3
runs: 2
php_code_sniffer:
enabled: true
config:
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ language: php
sudo: false

php:
- 5.6
- 7.0
- 7.1
- nightly
Expand All @@ -13,7 +12,7 @@ matrix:
- php: nightly

env:
- TESTBENCH_VERSION=3.4.*
- TESTBENCH_VERSION=3.5.*

before_script:
- travis_retry composer self-update
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 | 5.1 | 5.2 | 5.3 | 5.4` are supported.
- Laravel `5.0 | 5.1 | 5.2 | 5.3 | 5.4 | 5.5` are supported.
- Ready to use (Views, Routes, controllers … 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 | 5.1 | 5.2 | 5.3 | 5.4` are supported.
- Laravel `5.0 | 5.1 | 5.2 | 5.3 | 5.4 | 5.5` are supported.
- Ready to use (Views, Routes, controllers … 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
8 changes: 7 additions & 1 deletion _docs/1.Installation-and-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

The LogViewer package has a few system requirements:

- PHP >= 5.6.4
- PHP >= 7.0

## Application Requirements

Expand Down Expand Up @@ -41,15 +41,18 @@ Laravel uses the [Monolog PHP logging library](https://github.com/Seldaek/monolo
|:--------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
| ![LogViewer v4.2.x][log_viewer_4_2_x] | ![Laravel v5.0][laravel_5_0] ![Laravel v5.1][laravel_5_1] ![Laravel v5.2][laravel_5_2] ![Laravel v5.3][laravel_5_3] |
| ![LogViewer v4.3.x][log_viewer_4_3_x] | ![Laravel v5.4][laravel_5_4] |
| ![LogViewer v4.4.x][log_viewer_4_4_x] | ![Laravel v5.5][laravel_5_5] |

[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"
[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2"
[laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3"
[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4"
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"

[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.*"

## Composer

Expand All @@ -58,6 +61,9 @@ You can install this package via [Composer](http://getcomposer.org/) by running
## Laravel

### Setup

> **NOTE :** The package will automatically register itself if you're using Laravel `>= v5.5`, so you can skip this section.
Once the package is installed, you can register the service provider in `config/app.php` in the `providers` array:

```php
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=5.6",
"php": ">=7.0",
"psr/log": "~1.0",
"arcanedev/support": "~4.1"
},
"require-dev": {
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0"
"phpunit/phpunit": "~6.0",
"phpunit/phpcov": "~4.0"
},
"autoload": {
"psr-4": {
Expand All @@ -34,13 +34,13 @@
}
},
"scripts": {
"testbench": "composer require --dev \"orchestra/testbench-browser-kit=~3.4\""
"testbench": "composer require --dev \"orchestra/testbench-browser-kit=~3.0\""
},
"extra": {
"branch-alias": {
"dev-master": "4.3.x-dev"
"laravel": {
"providers": [
"Arcanedev\\LogViewer\\LogViewerServiceProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable" : true
}
}
9 changes: 3 additions & 6 deletions tests/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,12 @@ public function it_must_throw_log_not_found_exception_on_show()
public function it_must_throw_log_not_found_exception_on_delete()
{
try {
$server = ['HTTP_X-Requested-With' => 'XMLHttpRequest'];
$response = $this->route('DELETE', 'log-viewer::logs.delete', ['0000-00-00'], [], [], [], ['HTTP_X-Requested-With' => 'XMLHttpRequest']);

$this->route('DELETE', 'log-viewer::logs.delete', ['0000-00-00'], [], [], [], $server);
$this->assertSame(['message' => 'Server Error'], json_decode($response->content(), true));
}
catch(\Exception $exception) {
$this->assertInstanceOf(
\Arcanedev\LogViewer\Exceptions\FilesystemException::class,
$exception
);
$this->assertInstanceOf(\Arcanedev\LogViewer\Exceptions\FilesystemException::class, $exception);
$this->assertStringStartsWith('The log(s) could not be located at : ', $exception->getMessage());
}
}
Expand Down
29 changes: 28 additions & 1 deletion tests/Utilities/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,34 @@ public function it_can_get_tree()
/** @test */
public function it_can_get_translated_tree()
{
// TODO: Complete the test
$this->app->setLocale('fr');

$expected = [
'2015-01-02' => [
'all' => ['name' => 'Tous', 'count' => 8],
'emergency' => ['name' => 'Urgence', 'count' => 1],
'alert' => ['name' => 'Alerte', 'count' => 1],
'critical' => ['name' => 'Critique', 'count' => 1],
'error' => ['name' => 'Erreur', 'count' => 1],
'warning' => ['name' => 'Avertissement', 'count' => 1],
'notice' => ['name' => 'Notice', 'count' => 1],
'info' => ['name' => 'Info', 'count' => 1],
'debug' => ['name' => 'Debug', 'count' => 1],
],
'2015-01-01' => [
'all' => ['name' => 'Tous', 'count' => 8],
'emergency' => ['name' => 'Urgence', 'count' => 1],
'alert' => ['name' => 'Alerte', 'count' => 1],
'critical' => ['name' => 'Critique', 'count' => 1],
'error' => ['name' => 'Erreur', 'count' => 1],
'warning' => ['name' => 'Avertissement', 'count' => 1],
'notice' => ['name' => 'Notice', 'count' => 1],
'info' => ['name' => 'Info', 'count' => 1],
'debug' => ['name' => 'Debug', 'count' => 1],
]
];

$this->assertSame($expected, $tree = $this->logFactory->tree(true));
}

/** @test */
Expand Down
62 changes: 59 additions & 3 deletions tests/Utilities/LogMenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,65 @@ public function it_can_be_instantiated()
/** @test */
public function it_can_make_menu_with_helper()
{
$log = $this->getLog('2015-01-01');
$log = $this->getLog('2015-01-01');

$menu = log_menu()->make($log);
// TODO: complete the assertion
$expected = [
'all' => [
'name' => 'All',
'count' => 8,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/all',
'icon' => '<i class="fa fa-fw fa-list"></i>',
],
'emergency' => [
'name' => 'Emergency',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/emergency',
'icon' => '<i class="fa fa-fw fa-bug"></i>',
],
'alert' => [
'name' => 'Alert',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/alert',
'icon' => '<i class="fa fa-fw fa-bullhorn"></i>',
],
'critical' => [
'name' => 'Critical',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/critical',
'icon' => '<i class="fa fa-fw fa-heartbeat"></i>',
],
'error' => [
'name' => 'Error',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/error',
'icon' => '<i class="fa fa-fw fa-times-circle"></i>',
],
'warning' => [
'name' => 'Warning',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/warning',
'icon' => '<i class="fa fa-fw fa-exclamation-triangle"></i>',
],
'notice' => [
'name' => 'Notice',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/notice',
'icon' => '<i class="fa fa-fw fa-exclamation-circle"></i>',
],
'info' => [
'name' => 'Info',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/info',
'icon' => '<i class="fa fa-fw fa-info-circle"></i>',
],
'debug' => [
'name' => 'Debug',
'count' => 1,
'url' => 'http://localhost/log-viewer/logs/2015-01-01/debug',
'icon' => '<i class="fa fa-fw fa-life-ring"></i>',
],
];

$this->assertSame($expected, $menu = log_menu()->make($log));
}
}

0 comments on commit 5aacb3d

Please sign in to comment.