Skip to content

Commit 224cac5

Browse files
committed
Move hasHeadlessDisabled() and shouldStartMaximized() to
`Laravel\Dusk\TestCase`. We don't typically change this configuration. It shouldn't be in the stubs file. Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent c9edd39 commit 224cac5

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/TestCase.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ protected function user()
6969
throw new Exception('User resolver has not been set.');
7070
}
7171

72+
/**
73+
* Determine whether the Dusk command has disabled headless mode.
74+
*/
75+
protected function hasHeadlessDisabled(): bool
76+
{
77+
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
78+
isset($_ENV['DUSK_HEADLESS_DISABLED']);
79+
}
80+
81+
/**
82+
* Determine if the browser window should start maximized.
83+
*/
84+
protected function shouldStartMaximized(): bool
85+
{
86+
return isset($_SERVER['DUSK_START_MAXIMIZED']) ||
87+
isset($_ENV['DUSK_START_MAXIMIZED']);
88+
}
89+
7290
/**
7391
* Determine if the tests are running within Laravel Sail.
7492
*

stubs/DuskTestCase.stub

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,4 @@ abstract class DuskTestCase extends BaseTestCase
4545
)
4646
);
4747
}
48-
49-
/**
50-
* Determine whether the Dusk command has disabled headless mode.
51-
*/
52-
protected function hasHeadlessDisabled(): bool
53-
{
54-
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
55-
isset($_ENV['DUSK_HEADLESS_DISABLED']);
56-
}
57-
58-
/**
59-
* Determine if the browser window should start maximized.
60-
*/
61-
protected function shouldStartMaximized(): bool
62-
{
63-
return isset($_SERVER['DUSK_START_MAXIMIZED']) ||
64-
isset($_ENV['DUSK_START_MAXIMIZED']);
65-
}
6648
}

0 commit comments

Comments
 (0)