public function testGetSearchAttributeMetadataForMashableInboxByModelClassName()
 {
     $conversationRules = new ConversationMashableInboxRules();
     $expected = MashableUtil::mergeMetadata(MashableUtil::mergeMetadata($conversationRules->getMetadataForMashableInbox(), $conversationRules->getSearchAttributeData('test')), $conversationRules->getMetadataFilteredByFilteredBy(MashableInboxForm::FILTERED_BY_ALL));
     $searchAttributesData = MashableUtil::getSearchAttributeMetadataForMashableInboxByModelClassName(array('Conversation'), MashableInboxForm::FILTERED_BY_ALL, 'test');
     $this->assertEquals($expected, $searchAttributesData[0]['Conversation']);
     $missionRules = new MissionMashableInboxRules();
     $expected2 = MashableUtil::mergeMetadata(MashableUtil::mergeMetadata($missionRules->getMetadataForMashableInbox(), $missionRules->getSearchAttributeData('test')), $missionRules->getMetadataFilteredByFilteredBy(MashableInboxForm::FILTERED_BY_ALL));
     $searchAttributesData = MashableUtil::getSearchAttributeMetadataForMashableInboxByModelClassName(array('Conversation', 'Mission'), MashableInboxForm::FILTERED_BY_ALL, 'test');
     $this->assertEquals($expected, $searchAttributesData[0]['Conversation']);
     $this->assertEquals($expected2, $searchAttributesData[1]['Mission']);
 }
示例#2
0
 /**
  * Gets the listView that should be rendered based on the mashableInboxForm params
  * @param MashableInboxForm $mashableInboxForm
  * @return \MashableInboxListView
  */
 private function getMashableInboxListView($mashableInboxForm)
 {
     $modelClassNames = array_keys(MashableUtil::getModelDataForCurrentUserByInterfaceName('MashableInboxInterface'));
     $modelClassNamesAndSearchAttributeMetadataForMashableInbox = MashableUtil::getSearchAttributeMetadataForMashableInboxByModelClassName($modelClassNames, $mashableInboxForm->filteredBy, $mashableInboxForm->searchTerm);
     $modelClassNamesAndSortAttributes = MashableUtil::getSortAttributesByMashableInboxModelClassNames($modelClassNames);
     $dataProvider = new RedBeanModelsDataProvider('MashableInbox', $modelClassNamesAndSortAttributes, true, $modelClassNamesAndSearchAttributeMetadataForMashableInbox, array('pagination' => array('pageSize' => $this->pageSize)));
     $listView = new MashableInboxListView($this->getId(), $this->getModule()->getId(), 'MashableInbox', $dataProvider, array(), null, array('paginationParams' => GetUtil::getData()));
     return $listView;
 }