File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 20
20
use Guanguans \LaravelSoar \Outputs \JsonOutput ;
21
21
use Guanguans \LaravelSoar \Outputs \LogOutput ;
22
22
use Guanguans \LaravelSoar \Outputs \NullOutput ;
23
+ use Guanguans \LaravelSoar \Outputs \RayOutput ;
23
24
use Guanguans \LaravelSoar \Outputs \SoarBarOutput ;
24
25
25
26
beforeEach (function (): void {
93
94
->assertSee (NullOutput::class);
94
95
})->group (__DIR__ , __FILE__ );
95
96
97
+ it ('can output to ray ' , function (): void {
98
+ $ this ->get ('ray ' )
99
+ ->assertOk ()
100
+ // ->assertSee($this->see)
101
+ ->assertSee (RayOutput::class);
102
+ })->group (__DIR__ , __FILE__ );
103
+
96
104
it ('can output to SoarBar ' , function (): void {
97
105
$ this ->get ('soar-bar ' )
98
106
->assertOk ()
Original file line number Diff line number Diff line change 22
22
use Guanguans \LaravelSoar \Outputs \JsonOutput ;
23
23
use Guanguans \LaravelSoar \Outputs \LogOutput ;
24
24
use Guanguans \LaravelSoar \Outputs \NullOutput ;
25
+ use Guanguans \LaravelSoar \Outputs \RayOutput ;
25
26
use Guanguans \LaravelSoar \Outputs \SoarBarOutput ;
26
27
use Guanguans \LaravelSoar \SoarServiceProvider ;
27
28
use Illuminate \Database \Schema \Blueprint ;
@@ -209,6 +210,15 @@ protected function defineRoutes($router): void
209
210
$ query ();
210
211
}));
211
212
213
+ Route::get ('ray ' , fn () => tap (response (RayOutput::class), function () use ($ query ): void {
214
+ $ this ->app ->extend (OutputManager::class, function (OutputManager $ outputManager ): OutputManager {
215
+ $ outputManager [] = $ this ->app ->make (RayOutput::class);
216
+
217
+ return $ outputManager ;
218
+ });
219
+ $ query ();
220
+ }));
221
+
212
222
Route::get ('soar-bar ' , fn () => tap (response (SoarBarOutput::class), function () use ($ query ): void {
213
223
$ this ->app ->extend (OutputManager::class, function (OutputManager $ outputManager ): OutputManager {
214
224
$ outputManager [] = $ this ->app ->make (SoarBarOutput::class);
You can’t perform that action at this time.
0 commit comments