public function QueryFactoryTest::testGetKeysWildCardEnd in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php \Drupal\Tests\Core\Config\Entity\Query\QueryFactoryTest::testGetKeysWildCardEnd()
@covers ::getKeys @covers ::getValues
File
- core/
tests/ Drupal/ Tests/ Core/ Config/ Entity/ Query/ QueryFactoryTest.php, line 102
Class
- QueryFactoryTest
- @coversDefaultClass \Drupal\Core\Config\Entity\Query\QueryFactory @group Config
Namespace
Drupal\Tests\Core\Config\Entity\QueryCode
public function testGetKeysWildCardEnd() {
$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');
$config_entity_type
->expects($this
->atLeastOnce())
->method('id')
->willReturn('test_config_entity_type');
$query_factory = new QueryFactory($config_factory, $key_value_factory, $config_manager);
$method = new \ReflectionMethod($query_factory, 'getKeys');
$method
->setAccessible(TRUE);
$this
->expectException(\LogicException::class);
$this
->expectExceptionMessage('test_config_entity_type lookup key test.* ends with a wildcard this can not be used as a lookup');
$method
->invoke($query_factory, $this
->getConfigObject('test'), 'test.*', 'get', $config_entity_type);
}