You are here

public function ConfigEntityBaseUnitTest::testToArraySchemaException in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::testToArraySchemaException()

@covers ::toArray

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php, line 634
Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest.

Class

ConfigEntityBaseUnitTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityBase @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testToArraySchemaException() {
  $this->entityType
    ->expects($this
    ->any())
    ->method('getPropertiesToExport')
    ->willReturn(NULL);
  $this
    ->expectException(SchemaIncompleteException::class);
  $this
    ->expectExceptionMessageRegExp("/Entity type 'Mock_ConfigEntityTypeInterface_[^']*' is missing 'config_export' definition in its annotation/");
  $this->entity
    ->toArray();
}