Skip to content
Snippets Groups Projects
Commit 179e29e7 authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3245810 by phenaproxima, tedbow: Move ValidationResult and related...

Issue #3245810 by phenaproxima, tedbow: Move ValidationResult and related infrastructure into Package Manager
parent 62fe82b3
No related branches found
No related tags found
1 merge request!92Issue #3245810: Move ValidationResult and related infrastructure into Package Manager
Showing
with 190 additions and 34 deletions
...@@ -2,10 +2,48 @@ ...@@ -2,10 +2,48 @@
namespace Drupal\package_manager\Event; namespace Drupal\package_manager\Event;
use Drupal\package_manager\ValidationResult;
use Symfony\Contracts\EventDispatcher\Event; use Symfony\Contracts\EventDispatcher\Event;
/** /**
* Base class for all events related to the life cycle of the staging area. * Base class for all events related to the life cycle of the staging area.
*/ */
abstract class StageEvent extends Event { abstract class StageEvent extends Event {
/**
* The validation results.
*
* @var \Drupal\package_manager\ValidationResult[]
*/
protected $results = [];
/**
* Gets the validation results.
*
* @param int|null $severity
* (optional) The severity for the results to return. Should be one of the
* SystemManager::REQUIREMENT_* constants.
*
* @return \Drupal\package_manager\ValidationResult[]
* The validation results.
*/
public function getResults(?int $severity = NULL): array {
if ($severity !== NULL) {
return array_filter($this->results, function ($result) use ($severity) {
return $result->getSeverity() === $severity;
});
}
return $this->results;
}
/**
* Adds a validation result.
*
* @param \Drupal\package_manager\ValidationResult $validation_result
* The validation result.
*/
public function addValidationResult(ValidationResult $validation_result): void {
$this->results[] = $validation_result;
}
} }
...@@ -10,6 +10,8 @@ use Drupal\package_manager\Event\PreApplyEvent; ...@@ -10,6 +10,8 @@ use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreDestroyEvent; use Drupal\package_manager\Event\PreDestroyEvent;
use Drupal\package_manager\Event\PreRequireEvent; use Drupal\package_manager\Event\PreRequireEvent;
use Drupal\package_manager\Event\StageEvent;
use Drupal\system\SystemManager;
use PhpTuf\ComposerStager\Domain\BeginnerInterface; use PhpTuf\ComposerStager\Domain\BeginnerInterface;
use PhpTuf\ComposerStager\Domain\CleanerInterface; use PhpTuf\ComposerStager\Domain\CleanerInterface;
use PhpTuf\ComposerStager\Domain\CommitterInterface; use PhpTuf\ComposerStager\Domain\CommitterInterface;
...@@ -105,9 +107,9 @@ class Stage { ...@@ -105,9 +107,9 @@ class Stage {
$active_dir = $this->pathLocator->getActiveDirectory(); $active_dir = $this->pathLocator->getActiveDirectory();
$stage_dir = $this->pathLocator->getStageDirectory(); $stage_dir = $this->pathLocator->getStageDirectory();
$this->eventDispatcher->dispatch(new PreCreateEvent()); $this->dispatch(new PreCreateEvent());
$this->beginner->begin($active_dir, $stage_dir, $exclusions); $this->beginner->begin($active_dir, $stage_dir, $exclusions);
$this->eventDispatcher->dispatch(new PostCreateEvent()); $this->dispatch(new PostCreateEvent());
} }
/** /**
...@@ -120,9 +122,9 @@ class Stage { ...@@ -120,9 +122,9 @@ class Stage {
$command = array_merge(['require'], $constraints); $command = array_merge(['require'], $constraints);
$command[] = '--update-with-all-dependencies'; $command[] = '--update-with-all-dependencies';
$this->eventDispatcher->dispatch(new PreRequireEvent()); $this->dispatch(new PreRequireEvent());
$this->stager->stage($command, $this->pathLocator->getStageDirectory()); $this->stager->stage($command, $this->pathLocator->getStageDirectory());
$this->eventDispatcher->dispatch(new PostRequireEvent()); $this->dispatch(new PostRequireEvent());
} }
/** /**
...@@ -137,21 +139,36 @@ class Stage { ...@@ -137,21 +139,36 @@ class Stage {
$active_dir = $this->pathLocator->getActiveDirectory(); $active_dir = $this->pathLocator->getActiveDirectory();
$stage_dir = $this->pathLocator->getStageDirectory(); $stage_dir = $this->pathLocator->getStageDirectory();
$this->eventDispatcher->dispatch(new PreApplyEvent()); $this->dispatch(new PreApplyEvent());
$this->committer->commit($stage_dir, $active_dir, $exclusions); $this->committer->commit($stage_dir, $active_dir, $exclusions);
$this->eventDispatcher->dispatch(new PostApplyEvent()); $this->dispatch(new PostApplyEvent());
} }
/** /**
* Deletes the staging area. * Deletes the staging area.
*/ */
public function destroy(): void { public function destroy(): void {
$this->eventDispatcher->dispatch(new PreDestroyEvent()); $this->dispatch(new PreDestroyEvent());
$stage_dir = $this->pathLocator->getStageDirectory(); $stage_dir = $this->pathLocator->getStageDirectory();
if (is_dir($stage_dir)) { if (is_dir($stage_dir)) {
$this->cleaner->clean($stage_dir); $this->cleaner->clean($stage_dir);
} }
$this->eventDispatcher->dispatch(new PostDestroyEvent()); $this->dispatch(new PostDestroyEvent());
}
/**
* Dispatches an event and handles any errors that it collects.
*
* @param \Drupal\package_manager\Event\StageEvent $event
* The event object.
*/
protected function dispatch(StageEvent $event): void {
$this->eventDispatcher->dispatch($event);
$errors = $event->getResults(SystemManager::REQUIREMENT_ERROR);
if ($errors) {
throw new StageException($errors);
}
} }
} }
<?php
namespace Drupal\package_manager;
/**
* Exception thrown when the staging area encounters an error condition.
*/
class StageException extends \RuntimeException {
/**
* Any relevant validation results.
*
* @var \Drupal\package_manager\ValidationResult[]
*/
protected $results = [];
/**
* Constructs a StageException object.
*
* @param \Drupal\package_manager\ValidationResult[] $results
* Any relevant validation results.
* @param mixed ...$arguments
* Arguments to pass to the parent constructor.
*/
public function __construct(array $results = [], ...$arguments) {
$this->results = $results;
parent::__construct(...$arguments);
}
/**
* Gets the validation results.
*
* @return \Drupal\package_manager\ValidationResult[]
* The validation results.
*/
public function getResults(): array {
return $this->results;
}
}
<?php <?php
namespace Drupal\automatic_updates\Validation; namespace Drupal\package_manager;
use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\system\SystemManager; use Drupal\system\SystemManager;
......
...@@ -12,6 +12,8 @@ use Drupal\package_manager\Event\PreCreateEvent; ...@@ -12,6 +12,8 @@ use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreDestroyEvent; use Drupal\package_manager\Event\PreDestroyEvent;
use Drupal\package_manager\Event\PreRequireEvent; use Drupal\package_manager\Event\PreRequireEvent;
use Drupal\package_manager\Event\StageEvent; use Drupal\package_manager\Event\StageEvent;
use Drupal\package_manager\StageException;
use Drupal\package_manager\ValidationResult;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/** /**
...@@ -60,6 +62,12 @@ class StageEventsTest extends KernelTestBase implements EventSubscriberInterface ...@@ -60,6 +62,12 @@ class StageEventsTest extends KernelTestBase implements EventSubscriberInterface
*/ */
public function handleEvent(StageEvent $event): void { public function handleEvent(StageEvent $event): void {
array_push($this->events, get_class($event)); array_push($this->events, get_class($event));
// Adding a warning to the event, should not trigger an exception.
$result = ValidationResult::createWarning([
'This is a public service announcement, this is only a test.',
]);
$event->addValidationResult($result);
} }
/** /**
...@@ -86,4 +94,57 @@ class StageEventsTest extends KernelTestBase implements EventSubscriberInterface ...@@ -86,4 +94,57 @@ class StageEventsTest extends KernelTestBase implements EventSubscriberInterface
]); ]);
} }
/**
* Data provider for ::testError().
*
* @return string[][]
* Sets of arguments to pass to the test method.
*/
public function providerError(): array {
return [
[PreCreateEvent::class],
[PostCreateEvent::class],
[PreRequireEvent::class],
[PostRequireEvent::class],
[PreApplyEvent::class],
[PostApplyEvent::class],
[PreDestroyEvent::class],
[PostDestroyEvent::class],
];
}
/**
* Tests that an exception is thrown if an event collects an error.
*
* @param string $event_class
* The event class to test.
*
* @dataProvider providerError
*/
public function testError(string $event_class): void {
// Set up an event listener which will only flag an error for the event
// class under test.
$handler = function (StageEvent $event) use ($event_class): void {
if (get_class($event) === $event_class) {
$result = ValidationResult::createError(['Burn, baby, burn']);
$event->addValidationResult($result);
}
};
$this->container->get('event_dispatcher')
->addListener($event_class, $handler);
try {
$stage = $this->container->get('package_manager.stage');
$stage->create();
$stage->require(['ext-json:*']);
$stage->apply();
$stage->destroy();
$this->fail('Expected \Drupal\package_manager\StageException to be thrown.');
}
catch (StageException $e) {
$this->assertCount(1, $e->getResults());
}
}
} }
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
namespace Drupal\automatic_updates\Event; namespace Drupal\automatic_updates\Event;
use Drupal\automatic_updates\Validation\ValidationResult;
use Drupal\Component\EventDispatcher\Event; use Drupal\Component\EventDispatcher\Event;
use Drupal\package_manager\ComposerUtility; use Drupal\package_manager\ComposerUtility;
use Drupal\package_manager\ValidationResult;
/** /**
* Event fired when a site is updating. * Event fired when a site is updating.
...@@ -19,7 +19,7 @@ abstract class UpdateEvent extends Event { ...@@ -19,7 +19,7 @@ abstract class UpdateEvent extends Event {
/** /**
* The validation results. * The validation results.
* *
* @var \Drupal\automatic_updates\Validation\ValidationResult[] * @var \Drupal\package_manager\ValidationResult[]
*/ */
protected $results = []; protected $results = [];
...@@ -53,7 +53,7 @@ abstract class UpdateEvent extends Event { ...@@ -53,7 +53,7 @@ abstract class UpdateEvent extends Event {
/** /**
* Adds a validation result. * Adds a validation result.
* *
* @param \Drupal\automatic_updates\Validation\ValidationResult $validation_result * @param \Drupal\package_manager\ValidationResult $validation_result
* The validation result. * The validation result.
*/ */
public function addValidationResult(ValidationResult $validation_result): void { public function addValidationResult(ValidationResult $validation_result): void {
...@@ -67,7 +67,7 @@ abstract class UpdateEvent extends Event { ...@@ -67,7 +67,7 @@ abstract class UpdateEvent extends Event {
* (optional) The severity for the results to return. Should be one of the * (optional) The severity for the results to return. Should be one of the
* SystemManager::REQUIREMENT_* constants. * SystemManager::REQUIREMENT_* constants.
* *
* @return \Drupal\automatic_updates\Validation\ValidationResult[] * @return \Drupal\package_manager\ValidationResult[]
* The validation results. * The validation results.
*/ */
public function getResults(?int $severity = NULL): array { public function getResults(?int $severity = NULL): array {
......
...@@ -10,14 +10,14 @@ class UpdateException extends \RuntimeException { ...@@ -10,14 +10,14 @@ class UpdateException extends \RuntimeException {
/** /**
* The validation results for the exception. * The validation results for the exception.
* *
* @var \Drupal\automatic_updates\Validation\ValidationResult[] * @var \Drupal\package_manager\ValidationResult[]
*/ */
protected $validationResults; protected $validationResults;
/** /**
* Constructs an UpdateException object. * Constructs an UpdateException object.
* *
* @param \Drupal\automatic_updates\Validation\ValidationResult[] $validation_results * @param \Drupal\package_manager\ValidationResult[] $validation_results
* The validation results. * The validation results.
* @param string $message * @param string $message
* The exception message. * The exception message.
...@@ -30,7 +30,7 @@ class UpdateException extends \RuntimeException { ...@@ -30,7 +30,7 @@ class UpdateException extends \RuntimeException {
/** /**
* Gets the validation results for the exception. * Gets the validation results for the exception.
* *
* @return \Drupal\automatic_updates\Validation\ValidationResult[] * @return \Drupal\package_manager\ValidationResult[]
* The validation results. * The validation results.
*/ */
public function getValidationResults(): array { public function getValidationResults(): array {
......
...@@ -146,7 +146,7 @@ class ReadinessValidationManager { ...@@ -146,7 +146,7 @@ class ReadinessValidationManager {
* (optional) The severity for the results to return. Should be one of the * (optional) The severity for the results to return. Should be one of the
* SystemManager::REQUIREMENT_* constants. * SystemManager::REQUIREMENT_* constants.
* *
* @return \Drupal\automatic_updates\Validation\ValidationResult[]| * @return \Drupal\package_manager\ValidationResult[]|
* The validation result objects or NULL if no results are * The validation result objects or NULL if no results are
* available or if the stored results are no longer valid. * available or if the stored results are no longer valid.
* *
...@@ -172,7 +172,7 @@ class ReadinessValidationManager { ...@@ -172,7 +172,7 @@ class ReadinessValidationManager {
* readiness check event are the same as the last time the event was * readiness check event are the same as the last time the event was
* dispatched. * dispatched.
* *
* @return \Drupal\automatic_updates\Validation\ValidationResult[]|null * @return \Drupal\package_manager\ValidationResult[]|null
* The stored results if available and still valid, otherwise null. * The stored results if available and still valid, otherwise null.
*/ */
protected function getStoredValidResults(): ?array { protected function getStoredValidResults(): ?array {
......
...@@ -4,7 +4,7 @@ namespace Drupal\automatic_updates\Validator; ...@@ -4,7 +4,7 @@ namespace Drupal\automatic_updates\Validator;
use Drupal\automatic_updates\Event\ReadinessCheckEvent; use Drupal\automatic_updates\Event\ReadinessCheckEvent;
use Drupal\automatic_updates\Event\UpdateEvent; use Drupal\automatic_updates\Event\UpdateEvent;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Core\Extension\ExtensionVersion; use Drupal\Core\Extension\ExtensionVersion;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Drupal\automatic_updates\Validator; namespace Drupal\automatic_updates\Validator;
use Drupal\automatic_updates\Event\ReadinessCheckEvent; use Drupal\automatic_updates\Event\ReadinessCheckEvent;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......
...@@ -4,7 +4,7 @@ namespace Drupal\automatic_updates\Validator; ...@@ -4,7 +4,7 @@ namespace Drupal\automatic_updates\Validator;
use Drupal\automatic_updates\Event\ReadinessCheckEvent; use Drupal\automatic_updates\Event\ReadinessCheckEvent;
use Drupal\automatic_updates\Event\UpdateEvent; use Drupal\automatic_updates\Event\UpdateEvent;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Component\FileSystem\FileSystem; use Drupal\Component\FileSystem\FileSystem;
use Drupal\Component\Utility\Bytes; use Drupal\Component\Utility\Bytes;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
......
...@@ -5,7 +5,7 @@ namespace Drupal\automatic_updates\Validator; ...@@ -5,7 +5,7 @@ namespace Drupal\automatic_updates\Validator;
use Drupal\automatic_updates\Event\PreStartEvent; use Drupal\automatic_updates\Event\PreStartEvent;
use Drupal\automatic_updates\Event\ReadinessCheckEvent; use Drupal\automatic_updates\Event\ReadinessCheckEvent;
use Drupal\automatic_updates\Event\UpdateEvent; use Drupal\automatic_updates\Event\UpdateEvent;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\Core\Update\UpdateRegistry; use Drupal\Core\Update\UpdateRegistry;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Drupal\automatic_updates\Validator; namespace Drupal\automatic_updates\Validator;
use Drupal\automatic_updates\Event\PreCommitEvent; use Drupal\automatic_updates\Event\PreCommitEvent;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......
...@@ -6,7 +6,7 @@ use Composer\Semver\Semver; ...@@ -6,7 +6,7 @@ use Composer\Semver\Semver;
use Drupal\automatic_updates\Event\PreStartEvent; use Drupal\automatic_updates\Event\PreStartEvent;
use Drupal\automatic_updates\Event\ReadinessCheckEvent; use Drupal\automatic_updates\Event\ReadinessCheckEvent;
use Drupal\automatic_updates\Event\UpdateEvent; use Drupal\automatic_updates\Event\UpdateEvent;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Core\Extension\ExtensionVersion; use Drupal\Core\Extension\ExtensionVersion;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
......
...@@ -5,7 +5,7 @@ namespace Drupal\automatic_updates\Validator; ...@@ -5,7 +5,7 @@ namespace Drupal\automatic_updates\Validator;
use Drupal\automatic_updates\Event\PreStartEvent; use Drupal\automatic_updates\Event\PreStartEvent;
use Drupal\automatic_updates\Event\ReadinessCheckEvent; use Drupal\automatic_updates\Event\ReadinessCheckEvent;
use Drupal\automatic_updates\Event\UpdateEvent; use Drupal\automatic_updates\Event\UpdateEvent;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\package_manager\PathLocator; use Drupal\package_manager\PathLocator;
......
...@@ -42,7 +42,7 @@ class TestChecker1 implements EventSubscriberInterface { ...@@ -42,7 +42,7 @@ class TestChecker1 implements EventSubscriberInterface {
* This method is static to enable setting the expected messages before the * This method is static to enable setting the expected messages before the
* test module is enabled. * test module is enabled.
* *
* @param \Drupal\automatic_updates\Validation\ValidationResult[]|\Throwable|null $checker_results * @param \Drupal\package_manager\ValidationResult[]|\Throwable|null $checker_results
* The test validation results, or an exception to throw, or NULL to delete * The test validation results, or an exception to throw, or NULL to delete
* stored results. * stored results.
* @param string $event_name * @param string $event_name
......
...@@ -113,7 +113,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -113,7 +113,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase {
$this->drupalLogin($this->checkerRunnerUser); $this->drupalLogin($this->checkerRunnerUser);
$this->drupalGet('admin/reports/status'); $this->drupalGet('admin/reports/status');
$this->assertNoErrors(TRUE); $this->assertNoErrors(TRUE);
/** @var \Drupal\automatic_updates\Validation\ValidationResult[] $expected_results */ /** @var \Drupal\package_manager\ValidationResult[] $expected_results */
$expected_results = $this->testResults['checker_1']['1 error']; $expected_results = $this->testResults['checker_1']['1 error'];
TestChecker1::setTestResult($expected_results); TestChecker1::setTestResult($expected_results);
...@@ -382,7 +382,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -382,7 +382,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase {
/** /**
* Asserts that the displayed readiness requirement contains warnings. * Asserts that the displayed readiness requirement contains warnings.
* *
* @param \Drupal\automatic_updates\Validation\ValidationResult[] $expected_results * @param \Drupal\package_manager\ValidationResult[] $expected_results
* The readiness check results that should be visible. * The readiness check results that should be visible.
* @param bool $run_link * @param bool $run_link
* (optional) Whether there should be a link to run the readiness checks. * (optional) Whether there should be a link to run the readiness checks.
...@@ -395,7 +395,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -395,7 +395,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase {
/** /**
* Asserts that the displayed readiness requirement contains errors. * Asserts that the displayed readiness requirement contains errors.
* *
* @param \Drupal\automatic_updates\Validation\ValidationResult[] $expected_results * @param \Drupal\package_manager\ValidationResult[] $expected_results
* The readiness check results that should be visible. * The readiness check results that should be visible.
* @param bool $run_link * @param bool $run_link
* (optional) Whether there should be a link to run the readiness checks. * (optional) Whether there should be a link to run the readiness checks.
...@@ -413,7 +413,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -413,7 +413,7 @@ class ReadinessValidationTest extends AutomaticUpdatesFunctionalTestBase {
* be. Can be one of 'error', 'warning', 'checked', or 'ok'. * be. Can be one of 'error', 'warning', 'checked', or 'ok'.
* @param string $preamble * @param string $preamble
* The text that should appear before the result messages. * The text that should appear before the result messages.
* @param \Drupal\automatic_updates\Validation\ValidationResult[] $expected_results * @param \Drupal\package_manager\ValidationResult[] $expected_results
* The expected readiness check results, in the order we expect them to be * The expected readiness check results, in the order we expect them to be
* displayed. * displayed.
* @param bool $run_link * @param bool $run_link
......
...@@ -4,7 +4,7 @@ namespace Drupal\Tests\automatic_updates\Functional; ...@@ -4,7 +4,7 @@ namespace Drupal\Tests\automatic_updates\Functional;
use Drupal\automatic_updates\Event\PreStartEvent; use Drupal\automatic_updates\Event\PreStartEvent;
use Drupal\automatic_updates\Exception\UpdateException; use Drupal\automatic_updates\Exception\UpdateException;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\automatic_updates_test\ReadinessChecker\TestChecker1; use Drupal\automatic_updates_test\ReadinessChecker\TestChecker1;
use Drupal\Tests\automatic_updates\Traits\ValidationTestTrait; use Drupal\Tests\automatic_updates\Traits\ValidationTestTrait;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Drupal\Tests\automatic_updates\Kernel\ReadinessValidation; namespace Drupal\Tests\automatic_updates\Kernel\ReadinessValidation;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\automatic_updates\Validator\ComposerExecutableValidator; use Drupal\automatic_updates\Validator\ComposerExecutableValidator;
use Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase; use Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase;
use PhpTuf\ComposerStager\Exception\IOException; use PhpTuf\ComposerStager\Exception\IOException;
...@@ -111,7 +111,7 @@ class ComposerExecutableValidatorTest extends AutomaticUpdatesKernelTestBase { ...@@ -111,7 +111,7 @@ class ComposerExecutableValidatorTest extends AutomaticUpdatesKernelTestBase {
* *
* @param string $reported_version * @param string $reported_version
* The version of Composer that `composer --version` should report. * The version of Composer that `composer --version` should report.
* @param \Drupal\automatic_updates\Validation\ValidationResult[] $expected_results * @param \Drupal\package_manager\ValidationResult[] $expected_results
* The expected validation results. * The expected validation results.
* *
* @dataProvider providerComposerVersionValidation * @dataProvider providerComposerVersionValidation
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Drupal\Tests\automatic_updates\Kernel\ReadinessValidation; namespace Drupal\Tests\automatic_updates\Kernel\ReadinessValidation;
use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\package_manager\ValidationResult;
use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\package_manager\PathLocator; use Drupal\package_manager\PathLocator;
use Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase; use Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase;
......
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