You are here

public function EntityTest::testResolveOwner in GraphQL 8.4

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

File

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

Class

EntityTest
Data producers Entity test class.

Namespace

Drupal\Tests\graphql\Kernel\DataProducer

Code

public function testResolveOwner() : void {
  $this->entity
    ->expects($this
    ->once())
    ->method('getOwner')
    ->willReturn($this->user);
  $this
    ->assertEquals($this->user, $this
    ->executeDataProducer('entity_owner', [
    'entity' => $this->entity,
  ]));
  $this
    ->assertNull($this
    ->executeDataProducer('entity_owner', [
    'entity' => $this->entity_interface,
  ]));
}