File tree Expand file tree Collapse file tree 4 files changed +31
-13
lines changed Expand file tree Collapse file tree 4 files changed +31
-13
lines changed Original file line number Diff line number Diff line change 111
111
"league/flysystem-read-only" : " ^3.25.1" ,
112
112
"league/flysystem-sftp-v3" : " ^3.25.1" ,
113
113
"mockery/mockery" : " ^1.6.10" ,
114
- "orchestra/testbench-core" : " ^9.16.0 " ,
114
+ "orchestra/testbench-core" : " ^9.16.1 " ,
115
115
"pda/pheanstalk" : " ^5.0.6" ,
116
116
"php-http/discovery" : " ^1.15" ,
117
117
"phpstan/phpstan" : " ^2.0" ,
Original file line number Diff line number Diff line change 17
17
use Symfony \Component \Console \Helper \Table ;
18
18
use Symfony \Component \Console \Input \ArrayInput ;
19
19
use Symfony \Component \Console \Output \BufferedOutput ;
20
+ use Symfony \Component \Console \Output \ConsoleOutput ;
20
21
use Symfony \Component \Console \Question \ChoiceQuestion ;
21
22
22
23
class PendingCommand
@@ -359,6 +360,27 @@ public function run()
359
360
return $ exitCode ;
360
361
}
361
362
363
+ /**
364
+ * Debug the command.
365
+ *
366
+ * @return never
367
+ */
368
+ public function dd ()
369
+ {
370
+ $ consoleOutput = new OutputStyle (new ArrayInput ($ this ->parameters ), new ConsoleOutput ());
371
+ $ exitCode = $ this ->app ->make (Kernel::class)->call ($ this ->command , $ this ->parameters , $ consoleOutput );
372
+
373
+ $ streamOutput = $ consoleOutput ->getOutput ()->getStream ();
374
+ $ output = stream_get_contents ($ streamOutput );
375
+
376
+ fclose ($ streamOutput );
377
+
378
+ dd ([
379
+ 'exitCode ' => $ exitCode ,
380
+ 'output ' => $ output ,
381
+ ]);
382
+ }
383
+
362
384
/**
363
385
* Determine if expected questions / choices / outputs are fulfilled.
364
386
*
Original file line number Diff line number Diff line change 14
14
use PHPUnit \Framework \TestCase ;
15
15
use SplFileInfo ;
16
16
17
+ use function Orchestra \Testbench \terminate ;
18
+
17
19
class FilesystemTest extends TestCase
18
20
{
19
21
private static $ tempDir ;
@@ -547,7 +549,7 @@ public function testSharedGet()
547
549
$ files ->put (self ::$ tempDir .'/file.txt ' , $ content , true );
548
550
$ read = $ files ->get (self ::$ tempDir .'/file.txt ' , true );
549
551
550
- exit ( strlen ($ read ) === strlen ($ content ) ? 1 : 0 );
552
+ terminate ( $ this , strlen ($ read ) === strlen ($ content ) ? 1 : 0 );
551
553
}
552
554
}
553
555
Original file line number Diff line number Diff line change 8
8
use Illuminate \Foundation \Testing \Concerns \InteractsWithDeprecationHandling ;
9
9
use Illuminate \Http \RedirectResponse ;
10
10
use Illuminate \Routing \Controller ;
11
- use Illuminate \Support \Facades \Facade ;
12
11
use Orchestra \Testbench \TestCase ;
13
12
14
13
class RouteListCommandTest extends TestCase
@@ -123,6 +122,10 @@ public function testRouteCanBeFilteredByAction()
123
122
{
124
123
$ this ->withoutDeprecationHandling ();
125
124
125
+ RouteListCommand::resolveTerminalWidthUsing (function () {
126
+ return 82 ;
127
+ });
128
+
126
129
$ this ->router ->get ('/ ' , function () {
127
130
//
128
131
});
@@ -135,7 +138,7 @@ public function testRouteCanBeFilteredByAction()
135
138
' GET|HEAD foo/{user} Illuminate\Tests\Testing\Console\FooController@show '
136
139
)->expectsOutput ('' )
137
140
->expectsOutput (
138
- ' Showing [1] routes '
141
+ ' Showing [1] routes '
139
142
)
140
143
->expectsOutput ('' );
141
144
}
@@ -156,15 +159,6 @@ public function testDisplayRoutesExceptVendor()
156
159
->expectsOutput (' Showing [3] routes ' )
157
160
->expectsOutput ('' );
158
161
}
159
-
160
- protected function tearDown (): void
161
- {
162
- parent ::tearDown ();
163
-
164
- Facade::setFacadeApplication (null );
165
-
166
- RouteListCommand::resolveTerminalWidthUsing (null );
167
- }
168
162
}
169
163
170
164
class FooController extends Controller
You can’t perform that action at this time.
0 commit comments