/** * Test the getArgument() method. * * @covers ::getArgument() * @dataProvider providerGetArgument */ public function testGetArgument($options, Request $request, $expected) { $view = $this->getMockBuilder('Drupal\\views\\ViewExecutable')->disableOriginalConstructor()->setMethods(NULL)->getMock(); $view->setRequest($request); $display_plugin = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')->disableOriginalConstructor()->getMock(); $raw = new QueryParameter(array(), 'query_parameter', array()); $raw->init($view, $display_plugin, $options); $this->assertEquals($expected, $raw->getArgument()); }
public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['info'] = array('#markup' => '<p class="description">Attempt to pull bounding box info directly from the query string, bypassing Drupal\'s normal argument handling. If the argument does not exist, all values will be shown.</p>'); $form['arg_id'] = array('#type' => 'textfield', '#title' => t('Query argument ID'), '#size' => 60, '#maxlength' => 64, '#default_value' => $this->options['arg_id'] ? $this->options['arg_id'] : t('bbox'), '#description' => t('The ID of the query argument.<br />For OpenLayers use <em>bbox</em>, (as in "<em>?bbox=left,bottom,right,top</em>".)')); }