Skip to content

Commit b4b5775

Browse files
committed
make required changes
1 parent af1bffc commit b4b5775

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

tests/DefaultLogWriterTest.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
namespace Spatie\HttpLogger\Test;
4-
53
use Illuminate\Http\UploadedFile;
64

75
use function PHPUnit\Framework\assertStringContainsString;
@@ -13,7 +11,7 @@
1311
$this->logger = new DefaultLogWriter();
1412
});
1513

16-
test('it logs request method and uri', function () {
14+
it('logs request method and uri', function () {
1715
foreach (['post', 'put', 'patch', 'delete'] as $method) {
1816
$request = $this->makeRequest($method, $this->uri);
1917

@@ -28,7 +26,7 @@
2826
assertStringContainsString("DELETE {$this->uri}", $log);
2927
});
3028

31-
test('it will log the body', function () {
29+
it('will log the body', function () {
3230
$request = $this->makeRequest('post', $this->uri, [
3331
'name' => 'Name',
3432
]);
@@ -40,7 +38,7 @@
4038
assertStringContainsString('"name":"Name', $log);
4139
});
4240

43-
test('it will not log excluded fields', function () {
41+
it('will not log excluded fields', function () {
4442
$request = $this->makeRequest('post', $this->uri, [
4543
'name' => 'Name',
4644
'password' => 'none',
@@ -55,7 +53,7 @@
5553
assertStringNotContainsString('password_confirmation', $log);
5654
});
5755

58-
test('it logs files', function () {
56+
it('logs files', function () {
5957
$file = $this->getTempFile();
6058

6159
$request = $this->makeRequest('post', $this->uri, [], [], [
@@ -69,7 +67,7 @@
6967
assertStringContainsString('test.md', $log);
7068
});
7169

72-
test('it logs one file in an array', function () {
70+
it('logs one file in an array', function () {
7371
$file = $this->getTempFile();
7472

7573
$request = $this->makeRequest('post', $this->uri, [], [], [
@@ -85,7 +83,7 @@
8583
assertStringContainsString('test.md', $log);
8684
});
8785

88-
test('it logs multiple files in an array', function () {
86+
it('logs multiple files in an array', function () {
8987
$file = $this->getTempFile();
9088

9189
$request = $this->makeRequest('post', $this->uri, [], [], [
@@ -103,7 +101,7 @@
103101
assertStringContainsString('second.doc', $log);
104102
});
105103

106-
test('it logs using the default log level', function () {
104+
it('logs using the default log level', function () {
107105
$request = $this->makeRequest('post', $this->uri, [
108106
'name' => 'Name',
109107
]);
@@ -116,7 +114,7 @@
116114
assertStringContainsString('"name":"Name', $log);
117115
});
118116

119-
test('it logs using the configured log level', function () {
117+
it('logs using the configured log level', function () {
120118
config(['http-logger.log_level' => 'debug']);
121119
$request = $this->makeRequest('post', $this->uri, [
122120
'name' => 'Name',

tests/IntegrationTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
22

3-
namespace Spatie\HttpLogger\Test;
4-
53
use function PHPUnit\Framework\assertFileExists;
64

7-
test('it logs an incoming request via the middleware', function () {
5+
it('logs an incoming request via the middleware', function () {
86
$this->call('post', '/');
97

108
assertFileExists($this->getLogFile());

tests/LogNonGetRequestsTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
<?php
22

3-
namespace Spatie\HttpLogger\Test;
4-
53
use Spatie\HttpLogger\LogNonGetRequests;
64

75
beforeEach(function () {
86
$this->logProfile = new LogNonGetRequests();
97
});
108

11-
test('it logs post patch put delete', function () {
9+
it('logs post patch put delete', function () {
1210
foreach (['post', 'put', 'patch', 'delete'] as $method) {
1311
$request = $this->makeRequest($method, $this->uri);
1412

1513
$this->assertTrue($this->logProfile->shouldLogRequest($request), "{$method} should be logged.");
1614
}
1715
});
1816

19-
test('it doesnt log get head options trace', function () {
17+
it('doesnt log get head options trace', function () {
2018
foreach (['get', 'head', 'options', 'trace'] as $method) {
2119
$request = $this->makeRequest($method, $this->uri);
2220

0 commit comments

Comments
 (0)