Verified Commit a9dae8af authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3283794 by mondrake, longwave: Fix 'should return {type} but return...

Issue #3283794 by mondrake, longwave: Fix 'should return {type} but return statement is missing' PHPStan L0 errors in test code

(cherry picked from commit 9b485ec7)
parent 1301a82f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ protected function getExpectedNormalizedEntity() {
   */
  protected function getNormalizedPostEntity() {
    // @todo Update in https://www.drupal.org/node/2300677.
    return [];
  }

  /**
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ protected function getExpectedNormalizedEntity() {
   */
  protected function getNormalizedPostEntity() {
    // @todo Update in https://www.drupal.org/node/2300677.
    return [];
  }

}
+1 −3
Original line number Diff line number Diff line
@@ -179,10 +179,8 @@ public function postComment(EntityInterface $entity, $comment, $subject = '', $c
      $this->assertArrayHasKey(1, $match);
    }

    if (isset($match[1])) {
    return Comment::load($match[1]);
  }
  }

  /**
   * Checks current page for specified comment.
+4 −3
Original line number Diff line number Diff line
@@ -317,16 +317,17 @@ public function testPostDxWithoutCriticalBaseFields() {
   */
  protected function getExpectedUnauthorizedAccessMessage($method) {
    switch ($method) {
      case 'GET';
      case 'GET':
        return "The 'access comments' permission is required and the comment must be published.";

      case 'POST';
      case 'POST':
        return "The 'post comments' permission is required.";

      case 'PATCH';
      case 'PATCH':
        return "The 'edit own comments' permission is required, the user must be the comment author, and the comment must be published.";

      case 'DELETE':
      default:
        // \Drupal\comment\CommentAccessControlHandler::checkAccess() does not
        // specify a reason for not allowing a comment to be deleted.
        return '';
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ protected function getExpectedNormalizedEntity() {
   */
  protected function getNormalizedPostEntity() {
    // @todo Update in https://www.drupal.org/node/2300677.
    return [];
  }

}
Loading