Skip to content

Commit a4715fa

Browse files
Merge pull request #3 from stackkit/develop
Package conflicts with psr/log 3.x
2 parents 7619c4e + bbdb8b9 commit a4715fa

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

composer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
}
99
],
1010
"require": {
11-
"google/cloud-logging": "^1.10"
11+
"google/cloud-logging": "^1.10",
12+
"psr/log": "^1.0|^2.0"
1213
},
1314
"require-dev": {
1415
"phpstan/phpstan": "^1.8",
@@ -25,5 +26,8 @@
2526
"psr-4": {
2627
"Tests\\": "tests/"
2728
}
29+
},
30+
"conflict": {
31+
"psr/log": ">=3"
2832
}
2933
}

phpunit.xml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
stopOnFailure="false">
1111
<testsuites>
1212
<testsuite name="Testsuite">
13+
<file>./tests/LogTest.php</file>
1314
</testsuite>
1415
</testsuites>
1516
<php>

tests/LogTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Tests;
6+
7+
class LogTest extends TestCase
8+
{
9+
/** @test */
10+
public function it_can_log(): void
11+
{
12+
logger()->emergency('hey');
13+
}
14+
}

tests/TestCase.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Tests;
44

5+
use Stackkit\LaravelGoogleCloudLogging\ViaGoogleCloudLogger;
6+
57
class TestCase extends \Orchestra\Testbench\TestCase
68
{
79
protected function getPackageProviders($app)
@@ -11,6 +13,12 @@ protected function getPackageProviders($app)
1113

1214
protected function getEnvironmentSetUp($app)
1315
{
14-
//
16+
$app['config']->set('logging.channels.googlecloud', [
17+
'driver' => 'custom',
18+
'via' => ViaGoogleCloudLogger::class,
19+
'project_id' => env('GOOGLE_CLOUD_PROJECT_ID'),
20+
]);
21+
22+
$app['config']->set('logging.default', 'googlecloud');
1523
}
1624
}

0 commit comments

Comments
 (0)