File tree Expand file tree Collapse file tree 3 files changed +32
-5
lines changed
Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,10 @@ private static function buildLogMessageFromData(array $data): string
171171
172172 protected function registerBrowserLogger (): void
173173 {
174+ if (config ('logging.channels.browser ' ) !== null ) {
175+ return ;
176+ }
177+
174178 config ([
175179 'logging.channels.browser ' => [
176180 'driver ' => 'single ' ,
Original file line number Diff line number Diff line change 3535 expect (app ()->bound (Laravel \Roster \Roster::class))->toBeTrue ()
3636 ->and (config ('logging.channels.browser ' ))->not ->toBeNull ();
3737 });
38+
39+ it ('does not override an existing browser log channel ' , function (): void {
40+ Config::set ('boost.enabled ' , true );
41+ Config::set ('logging.channels.browser ' , [
42+ 'driver ' => 'daily ' ,
43+ 'path ' => storage_path ('logs/custom-browser.log ' ),
44+ ]);
45+ app ()->detectEnvironment (fn (): string => 'local ' );
46+
47+ $ provider = new BoostServiceProvider (app ());
48+ $ provider ->register ();
49+ $ provider ->boot (app ('router ' ));
50+
51+ expect (config ('logging.channels.browser.driver ' ))->toBe ('daily ' )
52+ ->and (config ('logging.channels.browser.path ' ))->toBe (storage_path ('logs/custom-browser.log ' ));
53+ });
3854});
3955
4056describe ('environment restrictions ' , function (): void {
Original file line number Diff line number Diff line change 1717
1818 expect ($ response )->isToolResult ()
1919 ->toolHasNoError ()
20- ->toolTextContains ('"key": "test.key" ' , '"value": "test_value" ' );
20+ ->toolTextContains ('"test.key" ' , '"test_value" ' );
21+
22+ expect (json_decode ((string ) $ response ->content (), true ))
23+ ->toBe (['key ' => 'test.key ' , 'value ' => 'test_value ' ]);
2124});
2225
2326test ('it returns nested config value ' , function (): void {
2427 $ tool = new GetConfig ;
2528 $ response = $ tool ->handle (new Request (['key ' => 'nested.config.key ' ]));
2629
2730 expect ($ response )->isToolResult ()
28- ->toolHasNoError ()
29- ->toolTextContains ('"key": "nested.config.key" ' , '"value": "nested_value" ' );
31+ ->toolHasNoError ();
32+
33+ expect (json_decode ((string ) $ response ->content (), true ))
34+ ->toBe (['key ' => 'nested.config.key ' , 'value ' => 'nested_value ' ]);
3035});
3136
3237test ('it returns error when config key does not exist ' , function (): void {
4348 $ response = $ tool ->handle (new Request (['key ' => 'app.name ' ]));
4449
4550 expect ($ response )->isToolResult ()
46- ->toolHasNoError ()
47- ->toolTextContains ('"key": "app.name" ' , '"value": "Test App" ' );
51+ ->toolHasNoError ();
52+
53+ expect (json_decode ((string ) $ response ->content (), true ))
54+ ->toBe (['key ' => 'app.name ' , 'value ' => 'Test App ' ]);
4855});
You can’t perform that action at this time.
0 commit comments