You are here

public function EntityLoadHelperTest::testEntityExistsReturnsFalseWhenAnEntityIsNotLoaded in YAML Content 8

Test entityExists method returns false when an entity is not loaded.

@covers ::entityExists

File

tests/src/Unit/EntityLoadHelper/EntityLoadHelperTest.php, line 124

Class

EntityLoadHelperTest
Test functionality of the EntityLoadHelper class.

Namespace

Drupal\Tests\yaml_content\Unit\EntityLoadHelper

Code

public function testEntityExistsReturnsFalseWhenAnEntityIsNotLoaded() {

  // Mock the load helper for testing.
  $this->loadHelper = $this
    ->getEntityLoadHelperMock([
    'loadEntity',
  ]);
  $this->loadHelper
    ->method('loadEntity')
    ->willReturn(FALSE);
  $this
    ->assertFalse($this->loadHelper
    ->entityExists('test_entity', []));
}