You are here

public function QueryFactoryTest::testGetKeys in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php \Drupal\Tests\Core\Config\Entity\Query\QueryFactoryTest::testGetKeys()

@covers ::getKeys @covers ::getValues

@dataProvider providerTestGetKeys

File

core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php, line 26
Contains \Drupal\Tests\Core\Config\Entity\Query\QueryFactoryTest.

Class

QueryFactoryTest
@coversDefaultClass \Drupal\Core\Config\Entity\Query\QueryFactory @group Config

Namespace

Drupal\Tests\Core\Config\Entity\Query

Code

public function testGetKeys(array $expected, $key, Config $config) {
  $config_factory = $this
    ->getMock('Drupal\\Core\\Config\\ConfigFactoryInterface');
  $key_value_factory = $this
    ->getMock('Drupal\\Core\\KeyValueStore\\KeyValueFactoryInterface');
  $config_manager = $this
    ->getMock('Drupal\\Core\\Config\\ConfigManagerInterface');
  $config_entity_type = $this
    ->getMock('Drupal\\Core\\Config\\Entity\\ConfigEntityTypeInterface');
  $query_factory = new QueryFactory($config_factory, $key_value_factory, $config_manager);
  $method = new \ReflectionMethod($query_factory, 'getKeys');
  $method
    ->setAccessible(TRUE);
  $actual = $method
    ->invoke($query_factory, $config, $key, 'get', $config_entity_type);
  $this
    ->assertEquals($expected, $actual);
}