function ConfigEntityBaseUnitTest::testToArraySchemaException

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::testToArraySchemaException()
  2. 10 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::testToArraySchemaException()
  3. 11.x 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 631

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->entityType
        ->expects($this->any())
        ->method('getClass')
        ->willReturn("FooConfigEntity");
    $this->expectException(SchemaIncompleteException::class);
    $this->expectExceptionMessage("Entity type 'FooConfigEntity' is missing 'config_export' definition in its annotation");
    $this->entity
        ->toArray();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.