You are here

protected function EntityShareCronServiceTest::createEntity in Entity Share Cron 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/EntityShareCronServiceTest.php \Drupal\Tests\entity_share_cron\Unit\EntityShareCronServiceTest::createEntity()

Creates a mocked entity with the specified UUID.

Parameters

string $uuid: The UUID of the entity to create.

Return value

\Drupal\Core\Entity\EntityInterface The mocked entity.

2 calls to EntityShareCronServiceTest::createEntity()
EntityShareCronServiceTest::testSynchronizationCreateOnly in tests/src/Unit/EntityShareCronServiceTest.php
Tests synchronization when only entity creation is allowed.
EntityShareCronServiceTest::testSynchronizationUpdateOnly in tests/src/Unit/EntityShareCronServiceTest.php
Tests synchronization when only entity update is allowed.

File

tests/src/Unit/EntityShareCronServiceTest.php, line 263

Class

EntityShareCronServiceTest
@coversDefaultClass \Drupal\entity_share_cron\EntityShareCronService @group entity_share_cron

Namespace

Drupal\Tests\entity_share_cron\Unit

Code

protected function createEntity($uuid) {
  $entity = $this
    ->createMock('Drupal\\Core\\Entity\\EntityInterface');
  $entity
    ->expects($this
    ->any())
    ->method('uuid')
    ->will($this
    ->returnValue($uuid));
  return $entity;
}