Commit ba65bdaf authored by catch's avatar catch
Browse files

Issue #3316815 by mondrake: Fix PHPStan L0 issues for calls to crufty drupalPost* methods

(cherry picked from commit 78f3dbf1)
parent f63bba46
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -1163,25 +1163,6 @@ protected function setSiteInformation($site_name, $site_slogan) {
    $this->assertSession()->pageTextContains('The configuration options have been saved.');
  }

  /**
   * Get server-rendered contextual links for the given contextual link ids.
   *
   * @param array $ids
   *   An array of contextual link ids.
   * @param string $current_path
   *   The Drupal path for the page for which the contextual links are rendered.
   *
   * @return string
   *   The response body.
   */
  protected function renderContextualLinks($ids, $current_path) {
    $post = [];
    for ($i = 0; $i < count($ids); $i++) {
      $post['ids[' . $i . ']'] = $ids[$i];
    }
    return $this->drupalPostWithFormat('contextual/render', 'json', $post, ['query' => ['destination' => $current_path]]);
  }

  /**
   * Asserts that a textarea with a given ID has been disabled from editing.
   *
+0 −22
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Drupal\Component\Serialization\Json;

/**
 * Create a node with revisions and test viewing, saving, reverting, and
@@ -361,27 +360,6 @@ public function testNodeRevisionWithoutLogMessage() {
    $this->assertEmpty($node_revision->revision_log->value, 'After a new node revision is saved with an empty log message, the log message for the node is empty.');
  }

  /**
   * Gets server-rendered contextual links for the given contextual links IDs.
   *
   * @param string[] $ids
   *   An array of contextual link IDs.
   * @param string $current_path
   *   The Drupal path for the page for which the contextual links are rendered.
   *
   * @return string
   *   The decoded JSON response body.
   */
  protected function renderContextualLinks(array $ids, $current_path) {
    $post = [];
    for ($i = 0; $i < count($ids); $i++) {
      $post['ids[' . $i . ']'] = $ids[$i];
    }
    $response = $this->drupalPost('contextual/render', 'application/json', $post, ['query' => ['destination' => $current_path]]);

    return Json::decode($response);
  }

  /**
   * Tests the revision translations are correctly reverted.
   */
+0 −10
Original line number Diff line number Diff line
@@ -540,11 +540,6 @@ parameters:
			count: 1
			path: modules/config_translation/src/FormElement/DateFormat.php

		-
			message: "#^Call to an undefined method Drupal\\\\Tests\\\\config_translation\\\\Functional\\\\ConfigTranslationUiTest\\:\\:drupalPostWithFormat\\(\\)\\.$#"
			count: 1
			path: modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php

		-
			message: "#^Method Drupal\\\\contact\\\\ContactFormEditForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
			count: 1
@@ -930,11 +925,6 @@ parameters:
			count: 1
			path: modules/node/tests/src/Functional/NodeRevisionsAllTest.php

		-
			message: "#^Call to an undefined method Drupal\\\\Tests\\\\node\\\\Functional\\\\NodeRevisionsTest\\:\\:drupalPost\\(\\)\\.$#"
			count: 1
			path: modules/node/tests/src/Functional/NodeRevisionsTest.php

		-
			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
			count: 1