Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.

This commit is contained in:
Pantheon Automation 2015-11-17 13:42:33 -08:00 committed by Greg Anderson
parent 4afb23bbd3
commit 7784f4c23d
929 changed files with 19798 additions and 5304 deletions

View file

@ -151,7 +151,7 @@ class RestExport extends PathPluginBase implements ResponseDisplayPluginInterfac
* {@inheritdoc}
*/
public function usesExposed() {
return FALSE;
return TRUE;
}
/**

View file

@ -50,7 +50,7 @@ class StyleSerializerTest extends PluginTestBase {
*
* @var array
*/
public static $testViews = array('test_serializer_display_field', 'test_serializer_display_entity', 'test_serializer_node_display_field');
public static $testViews = array('test_serializer_display_field', 'test_serializer_display_entity', 'test_serializer_node_display_field', 'test_serializer_node_exposed_filter');
/**
* A user with administrative privileges to look at test entity and configure views.
@ -609,4 +609,64 @@ class StyleSerializerTest extends PluginTestBase {
}
$this->assertEqual($serializer->serialize($expected, 'json'), (string) $renderer->renderRoot($build));
}
/**
* Tests the exposed filter works.
*
* There is an exposed filter on the title field which takes a title query
* parameter. This is set to filter nodes by those whose title starts with
* the value provided.
*/
public function testRestViewExposedFilter() {
$this->drupalCreateContentType(array('type' => 'page'));
$node0 = $this->drupalCreateNode(array('title' => 'Node 1'));
$node1 = $this->drupalCreateNode(array('title' => 'Node 11'));
$node2 = $this->drupalCreateNode(array('title' => 'Node 111'));
// Test that no filter brings back all three nodes.
$result = $this->drupalGetJSON('test/serialize/node-exposed-filter');
$expected = array(
0 => array(
'nid' => $node0->id(),
'body' => $node0->body->processed,
),
1 => array(
'nid' => $node1->id(),
'body' => $node1->body->processed,
),
2 => array(
'nid' => $node2->id(),
'body' => $node2->body->processed,
),
);
$this->assertEqual($result, $expected, 'Querying a view with no exposed filter returns all nodes.');
// Test that title starts with 'Node 11' query finds 2 of the 3 nodes.
$result = $this->drupalGetJSON('test/serialize/node-exposed-filter', ['query' => ['title' => 'Node 11']]);
$expected = array(
0 => array(
'nid' => $node1->id(),
'body' => $node1->body->processed,
),
1 => array(
'nid' => $node2->id(),
'body' => $node2->body->processed,
),
);
$cache_contexts = [
'languages:language_content',
'languages:language_interface',
'theme',
'request_format',
'user.node_grants:view',
'url',
];
$this->assertEqual($result, $expected, 'Querying a view with a starts with exposed filter on the title returns nodes whose title starts with value provided.');
$this->assertCacheContexts($cache_contexts);
}
}