You are here

public function EntityTest::testResolveLanguage in GraphQL 8.4

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

File

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

Class

EntityTest
Data producers Entity test class.

Namespace

Drupal\Tests\graphql\Kernel\DataProducer

Code

public function testResolveLanguage() : void {
  $language = $this
    ->getMockBuilder(LanguageInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->entity
    ->expects($this
    ->once())
    ->method('language')
    ->willReturn($language);
  $this
    ->assertEquals($language, $this
    ->executeDataProducer('entity_language', [
    'entity' => $this->entity,
  ]));
}