You are here

public function EntityTest::testResolveChanged in GraphQL 8.4

@covers \Drupal\graphql\Plugin\GraphQL\DataProducer\Entity\EntityChanged::resolve

File

tests/src/Kernel/DataProducer/EntityTest.php, line 94

Class

EntityTest
Data producers Entity test class.

Namespace

Drupal\Tests\graphql\Kernel\DataProducer

Code

public function testResolveChanged() : void {
  $this->entity
    ->expects($this
    ->once())
    ->method('getChangedTime')
    ->willReturn(17000000000);
  $this
    ->assertEquals('2508-09-16', $this
    ->executeDataProducer('entity_changed', [
    'format' => 'Y-m-d',
    'entity' => $this->entity,
  ]));
  $this
    ->assertNull($this
    ->executeDataProducer('entity_changed', [
    'format' => 'Y-m-d',
    'entity' => $this->entity_interface,
  ]));
}