File tree 3 files changed +32
-28
lines changed
3 files changed +32
-28
lines changed Original file line number Diff line number Diff line change @@ -19,26 +19,4 @@ protected function filterHeadlessArguments(array $args = [])
19
19
]);
20
20
})->values ()->all ();
21
21
}
22
-
23
- /**
24
- * Determine whether the Dusk command has disabled headless mode.
25
- *
26
- * @return bool
27
- */
28
- protected function hasHeadlessDisabled ()
29
- {
30
- return isset ($ _SERVER ['DUSK_HEADLESS_DISABLED ' ]) ||
31
- isset ($ _ENV ['DUSK_HEADLESS_DISABLED ' ]);
32
- }
33
-
34
- /**
35
- * Determine if the browser window should start maximized.
36
- *
37
- * @return bool
38
- */
39
- protected function shouldStartMaximized ()
40
- {
41
- return isset ($ _SERVER ['DUSK_START_MAXIMIZED ' ]) ||
42
- isset ($ _ENV ['DUSK_START_MAXIMIZED ' ]);
43
- }
44
22
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Derekmd \Dusk \Tests \Stubs ;
4
+
5
+ use Derekmd \Dusk \Concerns \TogglesHeadlessMode ;
6
+ use Laravel \Dusk \TestCase ;
7
+
8
+ class TogglesHeadlessStub extends TestCase
9
+ {
10
+ use TogglesHeadlessMode {
11
+ filterHeadlessArguments as filterHeadlessArgumentsProtected;
12
+ }
13
+
14
+ public function __construct ()
15
+ {
16
+ parent ::__construct ('TogglesHeadless ' );
17
+ }
18
+
19
+ public function createApplication ()
20
+ {
21
+ // Not needed in this test suite. Method must be declared for PHPUnit v10.
22
+ }
23
+
24
+ public function filterHeadlessArguments ($ args )
25
+ {
26
+ return $ this ->filterHeadlessArgumentsProtected ($ args );
27
+ }
28
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace Derekmd \Dusk \Tests ;
4
4
5
- use Derekmd \Dusk \Concerns \ TogglesHeadlessMode ;
5
+ use Derekmd \Dusk \Tests \ Stubs \ TogglesHeadlessStub ;
6
6
use PHPUnit \Framework \TestCase ;
7
7
8
8
class TogglesHeadlessModeTest extends TestCase
9
9
{
10
- use TogglesHeadlessMode;
11
-
12
- protected function tearDown () : void
10
+ protected function tearDown (): void
13
11
{
14
12
unset($ _ENV ['DUSK_HEADLESS_DISABLED ' ]);
15
13
@@ -20,7 +18,7 @@ public function test_building_arguments_with_headless_mode()
20
18
{
21
19
unset($ _ENV ['DUSK_HEADLESS_DISABLED ' ]);
22
20
23
- $ args = $ this ->filterHeadlessArguments ([
21
+ $ args = ( new TogglesHeadlessStub ) ->filterHeadlessArguments ([
24
22
'--disable-gpu ' ,
25
23
'--headless ' ,
26
24
'--window-size=1920,1080 ' ,
@@ -37,7 +35,7 @@ public function test_building_arguments_when_headless_mode_is_disabled()
37
35
{
38
36
$ _ENV ['DUSK_HEADLESS_DISABLED ' ] = true ;
39
37
40
- $ args = $ this ->filterHeadlessArguments ([
38
+ $ args = ( new TogglesHeadlessStub ) ->filterHeadlessArguments ([
41
39
'--disable-gpu ' ,
42
40
'--headless ' ,
43
41
'--window-size=1920,1080 ' ,
You can’t perform that action at this time.
0 commit comments