function QueryFactoryTest::testGetKeys

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php \Drupal\Tests\Core\Config\Entity\Query\QueryFactoryTest::testGetKeys()
  2. 10 core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php \Drupal\Tests\Core\Config\Entity\Query\QueryFactoryTest::testGetKeys()
  3. 11.x 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 21

Class

QueryFactoryTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21Entity%21Query%21QueryFactory.php/class/QueryFactory/8.9.x" title="Provides a factory for creating entity query objects for the config backend." class="local">\Drupal\Core\Config\Entity\Query\QueryFactory</a> @group Config

Namespace

Drupal\Tests\Core\Config\Entity\Query

Code

public function testGetKeys(array $expected, $key, Config $config) {
    $config_factory = $this->createMock('Drupal\\Core\\Config\\ConfigFactoryInterface');
    $key_value_factory = $this->createMock('Drupal\\Core\\KeyValueStore\\KeyValueFactoryInterface');
    $config_manager = $this->createMock('Drupal\\Core\\Config\\ConfigManagerInterface');
    $config_entity_type = $this->createMock('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);
}

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