public function testExportedFieldsWithJoinedStrategy()
{
$query = new Query(array('type' => 'read', 'model' => $this->_gallery, 'with' => array('Image.ImageTag.Tag')));
$result = $query->export($this->_db);
$this->assertEqual('*', $result['fields']);
$query = new Query(array('type' => 'read', 'model' => $this->_gallery, 'fields' => 'id', 'with' => array('Image.ImageTag.Tag')));
$result = $query->export($this->_db);
$expected = '{Gallery}.{id}';
$this->assertEqual($expected, $result['fields']);
$query = new Query(array('type' => 'read', 'model' => $this->_gallery, 'fields' => 'Tag.id', 'with' => array('Image.ImageTag.Tag')));
$result = $query->export($this->_db);
$expected = '{Gallery}.{id}, {Tag}.{id}, {Image}.{id}, {ImageTag}.{id}';
$this->assertEqual($expected, $result['fields']);
$query = new Query(array('type' => 'read', 'model' => $this->_gallery, 'fields' => 'Tag', 'with' => array('Image.ImageTag.Tag')));
$result = $query->export($this->_db);
$expected = '{Gallery}.{id}, {Tag}.*, {Image}.{id}, {ImageTag}.{id}';
$this->assertEqual($expected, $result['fields']);
$query = new Query(array('type' => 'read', 'model' => $this->_gallery, 'fields' => 'Tag.*', 'with' => array('Image.ImageTag.Tag')));
$result = $query->export($this->_db);
$expected = '{Gallery}.{id}, {Tag}.*, {Image}.{id}, {ImageTag}.{id}';
$this->assertEqual($expected, $result['fields']);
}