Skip to content
Snippets Groups Projects
Commit 1fc702ea authored by Adam G-H's avatar Adam G-H Committed by Ted Bowman
Browse files

Issue #3295596 by phenaproxima: Functional tests should not disable the lock file validator

parent 51bf737d
No related branches found
No related tags found
No related merge requests found
{}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\Tests\automatic_updates\Functional; namespace Drupal\Tests\automatic_updates\Functional;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Drupal\package_manager_bypass\Beginner;
use Drupal\Tests\BrowserTestBase; use Drupal\Tests\BrowserTestBase;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -40,10 +41,6 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase { ...@@ -40,10 +41,6 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
// package_manager_bypass is disabling those operations. // package_manager_bypass is disabling those operations.
'automatic_updates.composer_executable_validator', 'automatic_updates.composer_executable_validator',
'package_manager.validator.composer_executable', 'package_manager.validator.composer_executable',
// Disable the lock file validator, because it may cause the tests to fail
// if either the active and stage directories don't have a composer.lock
// file, which is the case with some of our fixtures.
'package_manager.validator.lock_file',
// Always allow tests to run with Xdebug on. // Always allow tests to run with Xdebug on.
'automatic_updates.validator.xdebug', 'automatic_updates.validator.xdebug',
// Disable the symlink validator, since the running code base may contain // Disable the symlink validator, since the running code base may contain
...@@ -58,6 +55,7 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase { ...@@ -58,6 +55,7 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
$this->disableValidators($this->disableValidators); $this->disableValidators($this->disableValidators);
Beginner::setFixturePath(__DIR__ . '/../../fixtures/fake-site');
} }
/** /**
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace Drupal\Tests\automatic_updates\Functional; namespace Drupal\Tests\automatic_updates\Functional;
use Drupal\package_manager_bypass\Beginner;
use Drupal\package_manager_bypass\Stager; use Drupal\package_manager_bypass\Stager;
/** /**
...@@ -53,7 +52,6 @@ class UpdateLockTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -53,7 +52,6 @@ class UpdateLockTest extends AutomaticUpdatesFunctionalTestBase {
// We should be able to get partway through an update without issue. // We should be able to get partway through an update without issue.
$this->drupalLogin($user_1); $this->drupalLogin($user_1);
$this->drupalGet('/admin/modules/automatic-update'); $this->drupalGet('/admin/modules/automatic-update');
Beginner::setFixturePath(__DIR__ . '/../../fixtures/fake-site');
Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1'); Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1');
$page->pressButton('Update'); $page->pressButton('Update');
$this->checkForMetaRefresh(); $this->checkForMetaRefresh();
......
...@@ -9,7 +9,6 @@ use Drupal\package_manager\Event\PreApplyEvent; ...@@ -9,7 +9,6 @@ use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\automatic_updates_test\EventSubscriber\TestSubscriber1; use Drupal\automatic_updates_test\EventSubscriber\TestSubscriber1;
use Drupal\package_manager_bypass\Beginner;
use Drupal\package_manager_bypass\Stager; use Drupal\package_manager_bypass\Stager;
use Drupal\Tests\automatic_updates\Traits\ValidationTestTrait; use Drupal\Tests\automatic_updates\Traits\ValidationTestTrait;
use Drupal\Tests\package_manager\Traits\PackageManagerBypassTestTrait; use Drupal\Tests\package_manager\Traits\PackageManagerBypassTestTrait;
...@@ -46,7 +45,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -46,7 +45,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
// package_manager_bypass, which means these validators will complain // package_manager_bypass, which means these validators will complain
// because there is no actual Composer data for them to inspect. // because there is no actual Composer data for them to inspect.
$this->disableValidators[] = 'automatic_updates.staged_projects_validator'; $this->disableValidators[] = 'automatic_updates.staged_projects_validator';
$this->disableValidators[] = 'automatic_updates.validator.scaffold_file_permissions';
parent::setUp(); parent::setUp();
...@@ -336,7 +334,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -336,7 +334,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this->checkForUpdates(); $this->checkForUpdates();
$this->drupalGet('/admin/modules/automatic-update'); $this->drupalGet('/admin/modules/automatic-update');
Beginner::setFixturePath(__DIR__ . '/../../fixtures/fake-site');
Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1'); Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1');
$page->pressButton('Update to 9.8.1'); $page->pressButton('Update to 9.8.1');
$this->checkForMetaRefresh(); $this->checkForMetaRefresh();
...@@ -472,7 +469,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -472,7 +469,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$page = $this->getSession()->getPage(); $page = $this->getSession()->getPage();
$this->drupalGet('/admin/modules/automatic-update'); $this->drupalGet('/admin/modules/automatic-update');
Beginner::setFixturePath(__DIR__ . '/../../fixtures/fake-site');
Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1'); Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1');
// The warning should be visible. // The warning should be visible.
$assert_session = $this->assertSession(); $assert_session = $this->assertSession();
...@@ -574,7 +570,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -574,7 +570,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$cached_message = $this->setAndAssertCachedMessage(); $cached_message = $this->setAndAssertCachedMessage();
$this->drupalGet($update_form_url); $this->drupalGet($update_form_url);
Beginner::setFixturePath(__DIR__ . '/../../fixtures/fake-site');
Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1'); Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1');
$assert_session->pageTextNotContains($cached_message); $assert_session->pageTextNotContains($cached_message);
$page->pressButton('Update to 9.8.1'); $page->pressButton('Update to 9.8.1');
...@@ -604,7 +599,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -604,7 +599,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$page = $this->getSession()->getPage(); $page = $this->getSession()->getPage();
$this->drupalGet('/admin/modules/automatic-update'); $this->drupalGet('/admin/modules/automatic-update');
Beginner::setFixturePath(__DIR__ . '/../../fixtures/fake-site');
Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1'); Stager::setFixturePath(__DIR__ . '/../../fixtures/staged/9.8.1');
$page->pressButton('Update to 9.8.1'); $page->pressButton('Update to 9.8.1');
$this->checkForMetaRefresh(); $this->checkForMetaRefresh();
...@@ -641,8 +635,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -641,8 +635,6 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this->setCoreVersion('9.8.0'); $this->setCoreVersion('9.8.0');
$this->checkForUpdates(); $this->checkForUpdates();
Beginner::setFixturePath(__DIR__ . '/../../fixtures/fake-site');
$this->drupalGet('/admin/modules/automatic-update'); $this->drupalGet('/admin/modules/automatic-update');
$error = new \Exception('Some Exception'); $error = new \Exception('Some Exception');
TestSubscriber1::setException($error, PostRequireEvent::class); TestSubscriber1::setException($error, PostRequireEvent::class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment