->
withHeader('User-Agent',
trim($result['user_agent'
]));
$response =
$http_client->
send($request);
// Ensure the test_page_test module got installed.
$this->
assertStringContainsString('Test page | Drupal',
(string) $response->
getBody());
// Ensure that there are files and database tables for the tear down command
// to clean up.
$key =
$this->
addTestDatabase($db_prefix);
$this->
assertGreaterThan(0,
count(Database::
getConnection('default',
$key)->
schema()->
findTables('%'
)));
$test_database =
new TestDatabase($db_prefix);
$test_file =
$this->root . DIRECTORY_SEPARATOR .
$test_database->
getTestSitePath() . DIRECTORY_SEPARATOR . '.htkey';
$this->
assertFileExists($test_file);
// Ensure the lock file exists.
$this->
assertFileExists($this->
getTestLockFile($db_prefix));
// Install another site so we can ensure the tear down command only removes
// one site at a time. Use the regular output.
$command_line =
$this->php . ' core/scripts/test-site.php install --setup-file core/tests/Drupal/TestSite/TestSiteInstallTestScript.php --db-url "' .
getenv('SIMPLETEST_DB'
) . '"';
$process = Process::
fromShellCommandline($command_line,
$this->root
);
// Set the timeout to a value that allows debugging.
$process->
setTimeout(500
);