You are here

public function EntityAccessEventTest::testDeprecatedSetEntityMethod in Hook Event Dispatcher 8

Deprecated setEntity method test.

Deprecated

should be removed when setEntity() method is removed.

File

tests/src/Unit/Entity/EntityAccessEventTest.php, line 48

Class

EntityAccessEventTest
Class EntityAccessEventTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Entity

Code

public function testDeprecatedSetEntityMethod() {
  $entity = $this
    ->createMock(EntityInterface::class);
  $operation = 'test';
  $account = $this
    ->createMock(AccountInterface::class);
  $event = new EntityAccessEvent($entity, $operation, $account);
  $otherEntity = $this
    ->createMock(EntityInterface::class);
  $event
    ->setEntity($otherEntity);
  self::assertEquals($otherEntity, $event
    ->getEntity());
}