QueryFactory example

/** * @covers ::getKeys * @covers ::getValues * * @dataProvider providerTestGetKeys */
  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');

    $actual = $method->invoke($query_factory$config$key, 'get', $config_entity_type);
    $this->assertEquals($expected$actual);
  }

  public function providerTestGetKeys() {
    $tests = [];

    $tests[] = [
      ['uuid:abc'],
      
Home | Imprint | This part of the site doesn't use cookies.