Commit c024e97b authored by catch's avatar catch

git commit -m Issue

parent 33d8ee8c
......@@ -83,7 +83,7 @@ public function preRender($values) {
'format' => $this->options['text_input_required_format'],
);
$handler = Views::handlerManager('area')->getHandler($options);
$handler->init($this->view, $options);
$handler->init($this->view, $this->displayHandler, $options);
$this->displayHandler->handlers['empty'] = array(
'area' => $handler,
);
......
......@@ -45,7 +45,7 @@ protected function setUp() {
// Create some random nodes.
for ($i = 0; $i < 5; $i++) {
$this->drupalCreateNode();
$this->drupalCreateNode(array('type' => 'article'));
}
}
......@@ -161,6 +161,30 @@ public function testExposedBlock() {
$this->assertEqual(count($elements), 1, 'One exposed form block found.');
}
/**
* Test the input required exposed form type.
*/
public function testInputRequired() {
$view = entity_load('view', 'test_exposed_form_buttons');
$display = &$view->getDisplay('default');
$display['display_options']['exposed_form']['type'] = 'input_required';
$view->save();
$this->drupalGet('test_exposed_form_buttons');
$this->assertResponse(200);
$this->helperButtonHasLabel('edit-submit-test-exposed-form-buttons', t('Apply'));
// Ensure that no results are displayed.
$rows = $this->xpath("//div[contains(@class, 'views-row')]");
$this->assertEqual(count($rows), 0, 'No rows are displayed by default when no input is provided.');
$this->drupalGet('test_exposed_form_buttons', array('query' => array('type' => 'article')));
// Ensure that results are displayed.
$rows = $this->xpath("//div[contains(@class, 'views-row')]");
$this->assertEqual(count($rows), 5, 'All rows are displayed by default when input is provided.');
}
/**
* Returns a views exposed form ID.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment