File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 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" ,
2526 "psr-4" : {
2627 "Tests\\ " : " tests/"
2728 }
29+ },
30+ "conflict" : {
31+ "psr/log" : " >=3"
2832 }
2933}
Original file line number Diff line number Diff line change 1010 stopOnFailure =" false" >
1111 <testsuites >
1212 <testsuite name =" Testsuite" >
13+ <file >./tests/LogTest.php</file >
1314 </testsuite >
1415 </testsuites >
1516 <php >
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 22
33namespace Tests ;
44
5+ use Stackkit \LaravelGoogleCloudLogging \ViaGoogleCloudLogger ;
6+
57class 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}
You can’t perform that action at this time.
0 commit comments