本文整理汇总了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));
}