Test tablesort().
protected function testTableSort() {
// While ordering on bundles do not give us a definite order, we can still
// assert that all entities from one bundle are after the other as the
// order dictates.
$_GET['sort'] = 'asc';
$_GET['order'] = 'Type';
$header = array(
'id' => array(
'data' => 'Id',
'specifier' => 'id',
),
'type' => array(
'data' => 'Type',
'specifier' => 'type',
),
);
$this->queryResults = array_values($this->factory
->get('entity_test_mulrev')
->tableSort($header)
->execute());
$this
->assertBundleOrder('asc');
$_GET['sort'] = 'desc';
$header = array(
'id' => array(
'data' => 'Id',
'specifier' => 'id',
),
'type' => array(
'data' => 'Type',
'specifier' => 'type',
),
);
$this->queryResults = array_values($this->factory
->get('entity_test_mulrev')
->tableSort($header)
->execute());
$this
->assertBundleOrder('desc');
// Ordering on ID is definite, however.
$_GET['order'] = 'Id';
$this->queryResults = $this->factory
->get('entity_test_mulrev')
->tableSort($header)
->execute();
$this
->assertResult(range(15, 1));
}