本文整理匯總了PHP中TestHelper::argListToDar方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestHelper::argListToDar方法的具體用法?PHP TestHelper::argListToDar怎麽用?PHP TestHelper::argListToDar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TestHelper
的用法示例。
在下文中一共展示了TestHelper::argListToDar方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
public function setUp()
{
$this->non_existent_ugroup_id = 102;
$this->integrators_ugroup_id = 103;
$this->project = stub('Project')->getID()->returns(123);
$dao = mock('UGroupDao');
$ugroup_definitions = array(array('ugroup_id' => "1", 'name' => "ugroup_anonymous_users_name_key", 'description' => "ugroup_anonymous_users_desc_key", 'group_id' => "100"), array('ugroup_id' => "2", 'name' => "ugroup_registered_users_name_key", 'description' => "ugroup_registered_users_desc_key", 'group_id' => "100"), array('ugroup_id' => "3", 'name' => "ugroup_project_members_name_key", 'description' => "ugroup_project_members_desc_key", 'group_id' => "100"), array('ugroup_id' => "4", 'name' => "ugroup_project_admins_name_key", 'description' => "ugroup_project_admins_desc_key", 'group_id' => "100"), array('ugroup_id' => "11", 'name' => "ugroup_file_manager_admin_name_key", 'description' => "ugroup_file_manager_admin_desc_key", 'group_id' => "100"), array('ugroup_id' => "12", 'name' => "ugroup_document_tech_name_key", 'description' => "ugroup_document_tech_desc_key", 'group_id' => "100"), array('ugroup_id' => "13", 'name' => "ugroup_document_admin_name_key", 'description' => "ugroup_document_admin_desc_key", 'group_id' => "100"), array('ugroup_id' => "14", 'name' => "ugroup_wiki_admin_name_key", 'description' => "ugroup_wiki_admin_desc_key", 'group_id' => "100"), array('ugroup_id' => "15", 'name' => "ugroup_tracker_admins_name_key", 'description' => "ugroup_tracker_admins_desc_key", 'group_id' => "100"), array('ugroup_id' => "100", 'name' => "ugroup_nobody_name_key", 'description' => "ugroup_nobody_desc_key", 'group_id' => "100"), array('ugroup_id' => "103", 'name' => "Integrators", 'description' => "", 'group_id' => "123"), array('ugroup_id' => "103", 'name' => "ugroup_supra_name_key", 'description' => "", 'group_id' => "123"));
foreach ($ugroup_definitions as $def) {
stub($dao)->searchByGroupIdAndUGroupId((int) $def['group_id'], (int) $def['ugroup_id'])->returnsDar($def);
stub($dao)->searchByGroupIdAndName((int) $def['group_id'], $def['name'])->returnsDar($def);
}
stub($dao)->searchByGroupIdAndUGroupId()->returnsEmptyDar();
stub($dao)->searchByGroupIdAndName()->returnsEmptyDar();
stub($dao)->searchDynamicAndStaticByGroupId(123)->returns(TestHelper::argListToDar($ugroup_definitions));
$this->ugroup_manager = new UGroupManager($dao);
}
示例2: returnsDar
/**
* Ease return of DatabaseAccessResult objects:
*
* Example:
* stub('Dao')->getStuff()->returnsDar(array('id' => '1'), array('id' => '2'));
*
* Returns 2 rows out of the database:
* |Id|
* |1 |
* |2 |
*/
public function returnsDar()
{
return $this->returns(TestHelper::argListToDar(func_get_args()));
}
示例3: returnsDarFromArray
/**
* Ease return of DatabaseAccessResult objects:
*
* Example:
* stub('Dao')->getStuff()->returnsDarFromArray(
* array(
* array('id' => '1'),
* array('id' => '2')
* )
* );
*
* Returns 2 rows out of the database:
* |Id|
* |1 |
* |2 |
*/
public function returnsDarFromArray($array)
{
return $this->returns(TestHelper::argListToDar($array));
}