Verified Commit f82ca85c authored by Jess's avatar Jess
Browse files

Issue #3529504 by acbramley, xjm, nicxvan, cmlara: Fix phpstan errors in UpdatePathTestTrait

parent da391c68
Loading
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ trait RequirementsPageTrait {
  /**
   * Handles the update requirements page.
   */
  protected function updateRequirementsProblem() {
  protected function updateRequirementsProblem(): void {
    // Assert a warning is shown on older test environments.
    $links = $this->getSession()->getPage()->findAll('named', ['link', 'try again']);

@@ -37,7 +37,7 @@ protected function updateRequirementsProblem() {
   *   next screen of the installer. If an expected warning is not found, or if
   *   a warning not in the list is present, a fail is raised.
   */
  protected function continueOnExpectedWarnings($expected_warnings = []) {
  protected function continueOnExpectedWarnings($expected_warnings = []): void {
    $this->assertSession()->pageTextNotContains('Errors found');
    $this->assertWarningSummaries($expected_warnings);
    $this->clickLink('continue anyway');
@@ -54,7 +54,7 @@ protected function continueOnExpectedWarnings($expected_warnings = []) {
   *   A list of warning summaries to expect on the requirements screen (e.g.
   *   'PHP', 'PHP OPcode caching', etc.).
   */
  protected function assertWarningSummaries(array $summaries) {
  protected function assertWarningSummaries(array $summaries): void {
    $this->assertRequirementSummaries($summaries, 'warning');
  }

@@ -68,7 +68,7 @@ protected function assertWarningSummaries(array $summaries) {
   *   A list of error summaries to expect on the requirements screen (e.g.
   *   'PHP', 'PHP OPcode caching', etc.).
   */
  protected function assertErrorSummaries(array $summaries) {
  protected function assertErrorSummaries(array $summaries): void {
    $this->assertRequirementSummaries($summaries, 'error');
  }

@@ -84,7 +84,7 @@ protected function assertErrorSummaries(array $summaries) {
   * @param string $type
   *   The type of requirement, either 'warning' or 'error'.
   */
  protected function assertRequirementSummaries(array $summaries, string $type) {
  protected function assertRequirementSummaries(array $summaries, string $type): void {
    // The selectors are different for Claro.
    $is_claro = stripos($this->getSession()->getPage()->getContent(), 'claro/css/theme/maintenance-page.css') !== FALSE;

+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ trait SchemaCheckTestTrait {
   * @param array $config_data
   *   The configuration data.
   */
  public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $config_name, $config_data) {
  public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $config_name, $config_data): void {
    $check = $this->checkConfigSchema($typed_config, $config_name, $config_data);
    $message = '';
    if ($check === FALSE) {
@@ -46,7 +46,7 @@ public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $c
   * @param string $config_name
   *   The configuration name.
   */
  public function assertConfigSchemaByName($config_name) {
  public function assertConfigSchemaByName($config_name): void {
    $config = $this->config($config_name);
    $this->assertConfigSchema(\Drupal::service('config.typed'), $config->getName(), $config->get());
  }
+3 −3
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ trait UpdatePathTestTrait {
   * @param string|null $update_url
   *   The update URL.
   */
  protected function runUpdates($update_url = NULL) {
  protected function runUpdates($update_url = NULL): void {
    if (!$update_url) {
      $update_url = Url::fromRoute('system.db_update');
    }
@@ -163,7 +163,7 @@ protected function runUpdates($update_url = NULL) {
  /**
   * Tests the selection page.
   */
  protected function doSelectionTest() {
  protected function doSelectionTest(): void {
    // No-op. Tests wishing to do test the selection page or the general
    // update.php environment before running update.php can override this method
    // and implement their required tests.
@@ -172,7 +172,7 @@ protected function doSelectionTest() {
  /**
   * Installs the update_script_test module and makes an update available.
   */
  protected function ensureUpdatesToRun() {
  protected function ensureUpdatesToRun(): void {
    \Drupal::service('module_installer')->install(['update_script_test']);
    // Reset the schema so there is an update to run.
    \Drupal::service('update.update_hook_registry')->setInstalledVersion('update_script_test', 8000);