You are here

protected function PurgeTest::assertNode in Lightning Workflow 8.2

Same name and namespace in other branches
  1. 8.3 modules/lightning_scheduler/tests/src/Functional/PurgeTest.php \Drupal\Tests\lightning_scheduler\Functional\PurgeTest::assertNode()
1 call to PurgeTest::assertNode()
PurgeTest::test in modules/lightning_scheduler/tests/src/Functional/PurgeTest.php

File

modules/lightning_scheduler/tests/src/Functional/PurgeTest.php, line 73

Class

PurgeTest
@group lightning @group lightning_workflow @group lightning_scheduler

Namespace

Drupal\Tests\lightning_scheduler\Functional

Code

protected function assertNode(NodeInterface $node) {
  $this
    ->assertFalse($node
    ->hasField('scheduled_publication'));
  $this
    ->assertFalse($node
    ->hasField('scheduled_moderation_state'));
  $this
    ->assertTrue($node
    ->hasField('scheduled_transition_date'));
  $this
    ->assertTrue($node
    ->hasField('scheduled_transition_state'));
  $date = $node
    ->get('scheduled_transition_date');
  $state = $node
    ->get('scheduled_transition_state');
  $this
    ->assertSame(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, $date
    ->getFieldDefinition()
    ->getFieldStorageDefinition()
    ->getCardinality());
  $this
    ->assertSame(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, $state
    ->getFieldDefinition()
    ->getFieldStorageDefinition()
    ->getCardinality());
  $this
    ->assertTrue($date
    ->isEmpty());
  $this
    ->assertTrue($state
    ->isEmpty());
}