You are here

public function EntityTest::testResolveCreated in GraphQL 8.4

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

File

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

Class

EntityTest
Data producers Entity test class.

Namespace

Drupal\Tests\graphql\Kernel\DataProducer

Code

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