You are here

public function ConfigEntityBaseUnitTest::testToArray in Zircon Profile 8.0

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

@covers ::toArray

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php, line 483
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 testToArray() {
  $this->typedConfigManager
    ->expects($this
    ->never())
    ->method('getDefinition');
  $this->entityType
    ->expects($this
    ->any())
    ->method('getPropertiesToExport')
    ->willReturn([
    'id' => 'configId',
    'dependencies' => 'dependencies',
  ]);
  $properties = $this->entity
    ->toArray();
  $this
    ->assertInternalType('array', $properties);
  $this
    ->assertEquals(array(
    'configId' => $this->entity
      ->id(),
    'dependencies' => array(),
  ), $properties);
}