Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
c97eb132
Commit
c97eb132
authored
Feb 21, 2022
by
catch
Browse files
Issue
#3265291
by xjm, neclimdul, longwave, Spokje: QuickStartTest: The waiting is the hardest part
parent
3effb672
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
View file @
c97eb132
...
...
@@ -108,14 +108,12 @@ public function testQuickStartCommand() {
$process
->
start
();
$guzzle
=
new
Client
();
$port
=
FALSE
;
while
(
$process
->
isRunning
()
)
{
if
(
preg_match
(
'/127.0.0.1:(\d+)/'
,
$
process
->
getO
utput
()
,
$match
))
{
$process
->
waitUntil
(
function
(
$type
,
$output
)
use
(
&
$port
)
{
if
(
preg_match
(
'/127.0.0.1:(\d+)/'
,
$
o
utput
,
$match
))
{
$port
=
$match
[
1
];
b
re
ak
;
re
turn
TRUE
;
}
// Wait for more output.
sleep
(
1
);
}
});
// The progress bar uses STDERR to write messages.
$this
->
assertStringContainsString
(
'Congratulations, you installed Drupal!'
,
$process
->
getErrorOutput
());
$this
->
assertNotFalse
(
$port
,
"Web server running on port
$port
"
);
...
...
@@ -157,12 +155,7 @@ public function testPhpRequirement() {
];
$process
=
new
Process
(
$install_command
,
NULL
,
[
'DRUPAL_DEV_SITE_PATH'
=>
$this
->
testDb
->
getTestSitePath
()]);
$process
->
setTimeout
(
500
);
$process
->
start
();
while
(
$process
->
isRunning
())
{
// Wait for more output.
sleep
(
1
);
}
$process
->
run
();
$error_output
=
$process
->
getErrorOutput
();
$this
->
assertStringContainsString
(
'Your PHP installation is too old.'
,
$error_output
);
$this
->
assertStringContainsString
(
'Drupal requires at least PHP'
,
$error_output
);
...
...
@@ -209,14 +202,12 @@ public function testQuickStartInstallAndServerCommands() {
$server_process
->
start
();
$guzzle
=
new
Client
();
$port
=
FALSE
;
while
(
$server_process
->
isRunning
()
)
{
if
(
preg_match
(
'/127.0.0.1:(\d+)
/'
,
$server_process
->
getO
utput
()
,
$match
))
{
$server_process
->
waitUntil
(
function
(
$type
,
$output
)
use
(
&
$port
)
{
if
(
preg_match
(
'/127.0.0.1:(\d+)
\/user\/reset\/1\//'
,
$o
utput
,
$match
))
{
$port
=
$match
[
1
];
b
re
ak
;
re
turn
TRUE
;
}
// Wait for more output.
sleep
(
1
);
}
});
$this
->
assertEquals
(
''
,
$server_process
->
getErrorOutput
());
$this
->
assertStringContainsString
(
"127.0.0.1:
$port
/user/reset/1/"
,
$server_process
->
getOutput
());
$this
->
assertNotFalse
(
$port
,
"Web server running on port
$port
"
);
...
...
catch
@catch
mentioned in commit
fbf951e8
·
Feb 21, 2022
mentioned in commit
fbf951e8
mentioned in commit fbf951e8549104cc56bfc911e155b281ccd258fc
Toggle commit list
catch
@catch
mentioned in commit
df17f235
·
Feb 21, 2022
mentioned in commit
df17f235
mentioned in commit df17f2354061273d09cecebd73da4fa6ff56c891
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment