You are here

private function EntityEventVariablesTest::assertAbstractEntityEventVariables in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php \Drupal\Tests\preprocess_event_dispatcher\Unit\EntityEventVariablesTest::assertAbstractEntityEventVariables()

Test the default entity event variable methods.

Parameters

\Drupal\preprocess_event_dispatcher\Variables\AbstractEntityEventVariables $variables: Variables object.

\Drupal\Core\Entity\EntityInterface $entity: Entity mock.

5 calls to EntityEventVariablesTest::assertAbstractEntityEventVariables()
EntityEventVariablesTest::testCommentEvent in modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php
Test a CommentPreprocessEvent.
EntityEventVariablesTest::testEckEntityEvent in modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php
Test a EckEntityPreprocessEvent.
EntityEventVariablesTest::testNodeEvent in modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php
Test a NodePreprocessEvent.
EntityEventVariablesTest::testParagraphEvent in modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php
Test a ParagraphPreprocessEvent.
EntityEventVariablesTest::testTaxonomyTermEvent in modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php
Test a TaxonomyTermPreprocessEvent.

File

modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php, line 153

Class

EntityEventVariablesTest
Class EntityEventVariablesTest.

Namespace

Drupal\Tests\preprocess_event_dispatcher\Unit

Code

private function assertAbstractEntityEventVariables(AbstractEntityEventVariables $variables, EntityInterface $entity) : void {
  $this
    ->assertAbstractEventVariables($variables);
  self::assertSame($entity, $variables
    ->getEntity());
  self::assertSame($entity
    ->getEntityType(), $variables
    ->getEntityType());
  self::assertSame($entity
    ->bundle(), $variables
    ->getEntityBundle());
  self::assertSame($entity
    ->getViewMode(), $variables
    ->getViewMode());
}