You are here

public function MockGcEventSubscriber::preNodeSave in GatherContent 8.4

Pre Node Save event listener.

File

tests/modules/gathercontent_test/src/EventSubscriber/MockGcEventSubscriber.php, line 32

Class

MockGcEventSubscriber
Class for testing events.

Namespace

Drupal\gathercontent_test\EventSubscriber

Code

public function preNodeSave(PreNodeSaveEvent $event) {
  $node = $event
    ->getNode();
  TestCase::assertTrue($node
    ->isNew(), 'The event was recieved after the entity got saved.');
  static::$preNodeSaveCalled++;
}