Skip to content
Snippets Groups Projects

Fake site should always be used for functional tests

1 file
+ 7
1
Compare changes
  • Side-by-side
  • Inline
@@ -41,7 +41,6 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
*/
protected function setUp(): void {
parent::setUp();
$this->useFixtureDirectoryAsActive(__DIR__ . '/../../../package_manager/tests/fixtures/fake_site');
// @todo Remove in https://www.drupal.org/project/automatic_updates/issues/3284443
$this->config('automatic_updates.settings')
->set('unattended.level', CronUpdateRunner::SECURITY)
@@ -55,9 +54,16 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
protected function installModulesFromClassProperty(ContainerInterface $container): void {
$container->get('module_installer')->install([
'package_manager_test_release_history',
'package_manager_bypass',
]);
$this->container = $container->get('kernel')->getContainer();
// To prevent tests from using the real codebase for Composer we must set
// the fixture path as early as possible. Automatic Updates will run
// readiness checks when the module is installed so this must be done before
// the parent class installs the modules needed for the test.
$this->useFixtureDirectoryAsActive(__DIR__ . '/../../../package_manager/tests/fixtures/fake_site');
// To prevent tests from making real requests to the Internet, use fake
// release metadata that exposes a pretend Drupal 9.8.2 release.
$this->setReleaseMetadata(__DIR__ . '/../../../package_manager/tests/fixtures/release-history/drupal.9.8.2.xml');
Loading