mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
Advanced Search: Sort allowed values
SVN:b1162[5473]
This commit is contained in:
@@ -40,23 +40,29 @@ class SearchFormTest extends ItopDataTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider GetFieldsProvider
|
||||
* @throws \OQLException
|
||||
*/
|
||||
public function testGetFields()
|
||||
public function testGetFields($sOQL, $iNum, $sList)
|
||||
{
|
||||
$oSearchForm = new SearchForm();
|
||||
$oSearch = \DBSearch::FromOQL("SELECT Contact");
|
||||
$oSearch = \DBSearch::FromOQL($sOQL);
|
||||
$aFields = $oSearchForm->GetFields(new \DBObjectSet($oSearch));
|
||||
$this->debug(json_encode($aFields, JSON_PRETTY_PRINT));
|
||||
$this->assertCount(7, $aFields['zlist']);
|
||||
$this->assertCount($iNum, $aFields[$sList]);
|
||||
|
||||
$oSearchForm = new SearchForm();
|
||||
$oSearch = \DBSearch::FromOQL("SELECT Contact AS C WHERE C.status = 'active'");
|
||||
$aFields = $oSearchForm->GetFields(new \DBObjectSet($oSearch));
|
||||
$this->debug(json_encode($aFields, JSON_PRETTY_PRINT));
|
||||
$this->assertCount(4, $aFields['others']);
|
||||
}
|
||||
|
||||
public function GetFieldsProvider()
|
||||
{
|
||||
return array(
|
||||
array("SELECT Contact", 7, 'zlist'),
|
||||
array("SELECT Contact AS C WHERE C.status = 'active'", 4, 'others'),
|
||||
array("SELECT Person", 11, 'zlist'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @dataProvider GetCriterionProvider
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user