Undefined method getViewMode in tests

Created on 22 November 2023, over 1 year ago

Problem/Motivation

Running phpstan with level 2 gives following errors:

 ------ ---------------------------------------------------------------------------------
  Line   modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php
 ------ ---------------------------------------------------------------------------------
  60     Call to an undefined method Drupal\Core\Entity\EntityInterface::getViewMode().
  78     Call to an undefined method Drupal\Core\Entity\EntityInterface::getViewMode().
  95     Call to an undefined method Drupal\Core\Entity\EntityInterface::getViewMode().
  112    Call to an undefined method Drupal\Core\Entity\EntityInterface::getViewMode().
  135    Call to an undefined method Drupal\Core\Entity\EntityInterface::getViewMode().
 ------ ---------------------------------------------------------------------------------

Steps to reproduce

Proposed resolution

Change the tests so they not call/mock undefined method.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024