You are here

public function BundleEntityDuplicatorTest::testDuplicateNoId in Entity API 8

@covers ::duplicate

File

tests/src/Kernel/BundleEntityDuplicatorTest.php, line 70

Class

BundleEntityDuplicatorTest
Tests the bundle entity duplicator.

Namespace

Drupal\Tests\entity\Kernel

Code

public function testDuplicateNoId() {
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('The $values[\'id\'] key is empty or missing.');
  $this->duplicator
    ->duplicate($this->bundleEntity, []);
}