• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP partial_mock函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中partial_mock函数的典型用法代码示例。如果您正苦于以下问题:PHP partial_mock函数的具体用法?PHP partial_mock怎么用?PHP partial_mock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了partial_mock函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $tracker_user_story_id = 103;
     $user_story_id = 107;
     $submitted_by = 102;
     $submitted_on = 1234567890;
     $use_artifact_permissions = false;
     $tracker = aMockTracker()->withId($this->tracker_id)->build();
     $this->layout = mock('Tracker_IDisplayTrackerLayout');
     $this->request = aRequest()->with('func', 'artifact-update')->build();
     $this->user = mock('PFUser');
     $this->formelement_factory = mock('Tracker_FormElementFactory');
     $this->hierarchy_factory = mock('Tracker_HierarchyFactory');
     $this->computed_field = mock('Tracker_FormElement_Field_Computed');
     $this->us_computed_field = mock('Tracker_FormElement_Field_Computed');
     $this->user_story = mock('Tracker_Artifact');
     $tracker_user_story = aMockTracker()->withId($tracker_user_story_id)->build();
     stub($this->user_story)->getTrackerId()->returns($tracker_user_story_id);
     stub($this->user_story)->getTracker()->returns($tracker_user_story);
     stub($this->user_story)->getId()->returns($user_story_id);
     $this->task = partial_mock('Tracker_Artifact', array('createNewChangeset'), array($this->artifact_id, $this->tracker_id, $submitted_by, $submitted_on, $use_artifact_permissions));
     $this->task->setHierarchyFactory($this->hierarchy_factory);
     $this->task->setTracker($tracker);
     $this->task->setFormElementFactory($this->formelement_factory);
     stub($this->task)->createNewChangeset()->returns(true);
     stub($this->formelement_factory)->getComputableFieldByNameForUser($tracker_user_story_id, Tracker::REMAINING_EFFORT_FIELD_NAME, $this->user)->returns($this->us_computed_field);
     stub($this->computed_field)->fetchCardValue($this->task)->returns(42);
     stub($this->us_computed_field)->fetchCardValue($this->user_story)->returns(23);
     $this->event_manager = mock('EventManager');
     $this->action = new Tracker_Action_UpdateArtifact($this->task, $this->formelement_factory, $this->event_manager);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:32,代码来源:UpdateArtifactTest.php


示例2: setUp

 public function setUp()
 {
     parent::setUp();
     ForgeConfig::store();
     ForgeConfig::set('sys_logger_level', 'debug');
     $this->ldap = partial_mock('LDAP', array('search'), array($this->ldap_params, mock('TruncateLevelLogger'), new LdapQueryEscaper()));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:LDAPTest.php


示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->bind = partial_mock('Tracker_FormElement_Field_List_Bind4Tests', array('getAllValues'));
     $this->v1 = mock('Tracker_FormElement_Field_List_BindValue');
     $this->v2 = mock('Tracker_FormElement_Field_List_BindValue');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:Tracker_FormElement_Field_List_BindTest.php


示例4: aSystemEventWithParameter

 public function aSystemEventWithParameter($parameters)
 {
     $id = $type = $owner = $priority = $status = $create_date = $process_date = $end_date = $log = null;
     $event = partial_mock($this->klass, array('getWikiPage'), array($id, $type, $owner, $parameters, $priority, $status, $create_date, $process_date, $end_date, $log));
     $event->injectDependencies($this->actions);
     return $event;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:SystemEvent_FULLTEXTSEARCH_WIKITest.class.php


示例5: setUp

 public function setUp()
 {
     parent::setUp();
     EventManager::setInstance(mock('EventManager'));
     $this->rm = partial_mock('ReferenceManager', array('_getReferenceDao', '_getCrossReferenceDao', 'loadReservedKeywords', 'getGroupIdFromArtifactIdForCallbackFunction', 'getGroupIdFromArtifactId'));
     $this->rm->__construct();
 }
开发者ID:nterray,项目名称:tuleap,代码行数:7,代码来源:ReferenceManagerTest.php


示例6: setUp

 public function setUp()
 {
     parent::setUp();
     $changeset_factory = mock('Tracker_Artifact_ChangesetFactory');
     $this->tracker = aMockTracker()->withId(1)->build();
     $this->new_artifact = partial_mock('Tracker_Artifact', array('createNewChangeset'));
     $this->new_artifact->setId($this->new_artifact_id);
     $this->layout = mock('Tracker_IDisplayTrackerLayout');
     $this->user = mock('PFUser');
     $this->xml_exporter = mock('Tracker_XML_Exporter_ArtifactXMLExporter');
     $this->xml_importer = mock('Tracker_Artifact_XMLImport');
     $this->xml_updater = mock('Tracker_XML_Updater_ChangesetXMLUpdater');
     $this->file_updater = mock('Tracker_XML_Updater_TemporaryFileXMLUpdater');
     $this->from_changeset = stub('Tracker_Artifact_Changeset')->getId()->returns($this->changeset_id);
     $this->from_artifact = partial_mock('Tracker_Artifact', array('getChangesetFactory'));
     $this->from_artifact->setId($this->artifact_id);
     $this->from_artifact->setTracker($this->tracker);
     $this->from_artifact->setChangesets(array($this->changeset_id => $this->from_changeset));
     stub($this->from_artifact)->getChangesetFactory()->returns($changeset_factory);
     stub($this->from_changeset)->getArtifact()->returns($this->from_artifact);
     $this->children_xml_exporter = mock('Tracker_XML_Exporter_ChildrenXMLExporter');
     $this->children_xml_importer = mock('Tracker_XML_Importer_ChildrenXMLImporter');
     $this->artifacts_imported_mapping = mock('Tracker_XML_Importer_ArtifactImportedMapping');
     $backend_logger = mock("BackendLogger");
     $this->logger = new Tracker_XML_Importer_CopyArtifactInformationsAggregator($backend_logger);
     $this->submitted_values = array();
     $this->artifact_factory = mock('Tracker_ArtifactFactory');
     stub($this->artifact_factory)->getArtifactByIdUserCanView($this->user, $this->artifact_id)->returns($this->from_artifact);
     $this->request = aRequest()->with('from_artifact_id', $this->artifact_id)->with('from_changeset_id', $this->changeset_id)->with('artifact', $this->submitted_values)->build();
     $this->action = new Tracker_Action_CopyArtifact($this->tracker, $this->artifact_factory, $this->xml_exporter, $this->xml_importer, $this->xml_updater, $this->file_updater, $this->children_xml_exporter, $this->children_xml_importer, $this->artifacts_imported_mapping, $this->logger);
     $this->a_mocked_artifact = mock("Tracker_Artifact");
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:32,代码来源:CopyArtifactTest.php


示例7: setUp

 public function setUp()
 {
     parent::setUp();
     $this->manifest_manager = mock('Git_Mirror_ManifestManager');
     $this->event = partial_mock('SystemEvent_GIT_GROKMIRROR_MANIFEST_CHECK', array('done', 'warning', 'error', 'getId'));
     $this->event->injectDependencies($this->manifest_manager);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:SystemEvent_GIT_GROKMIRROR_MANIFEST_CHECKTest.php


示例8: setUp

 public function setUp()
 {
     parent::setUp();
     $this->dao = mock('Git_GitoliteHousekeeping_GitoliteHousekeepingDao');
     $this->logger = mock('Logger');
     $this->gitgc = partial_mock('Git_GitoliteHousekeeping_GitoliteHousekeepingGitGc', array('execGitGcAsAppAdm'), array($this->dao, $this->logger, '/path/to/gitolite_admin_working_copy'));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:GitoliteHousekeepingGitGcTest.php


示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $this->ls_group_return = array('Administrators', 'Anonymous Users', 'Non-Interactive Users', 'Project Owners', 'Registered Users', 'project/project_members', 'project/project_admins', 'project/group_from_ldap');
     $this->gerrit_driver = partial_mock('Git_Driver_GerritLegacy', array('listGroups'));
     stub($this->gerrit_driver)->listGroups()->returns($this->ls_group_return);
     $this->gerrit_server = mock('Git_RemoteServer_GerritServer');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:Gerrit_groupExistsTest.php


示例10: testURLWithBuildWithParams

 function testURLWithBuildWithParams()
 {
     $job = partial_mock('HudsonJob', array('getHudsonControler'));
     stub($job)->getHudsonControler()->returns(mock('hudson'));
     $job->__construct('http://shunt.cro.enalean.com:8080/job/build_params/buildWithParameters?Stuff=truc');
     $this->assertEqual($job->getJobUrl(), 'http://shunt.cro.enalean.com:8080/job/build_params/api/xml');
     $this->assertEqual($job->getDoBuildUrl(), 'http://shunt.cro.enalean.com:8080/job/build_params/buildWithParameters?Stuff=truc');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:HudsonJobTest.php


示例11: setUp

 public function setUp()
 {
     parent::setUp();
     $this->ls_project_return = array('All-Projects', 'project');
     $this->gerrit_driver = partial_mock('Git_Driver_GerritLegacy', array('listParentProjects'));
     stub($this->gerrit_driver)->listParentProjects()->returns($this->ls_project_return);
     $this->gerrit_server = mock('Git_RemoteServer_GerritServer');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:Gerrit_projectExistsTest.php


示例12: setUp

 public function setUp()
 {
     parent::setUp();
     $this->gerrit_server = mock('Git_RemoteServer_GerritServer');
     $this->ssh = mock('Git_Driver_Gerrit_RemoteSSHCommand');
     $this->logger = mock('BackendLogger');
     $this->driver = partial_mock('Git_Driver_GerritLegacy', array('getGroupId'), array($this->ssh, $this->logger));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:Gerrit_removeIncludedGroupTest.php


示例13: setUp

 public function setUp()
 {
     parent::setUp();
     $this->ssh_key_dumper = mock('Git_Gitolite_SSHKeyDumper');
     $this->gerrit_server_factory = mock('Git_RemoteServer_GerritServerFactory');
     $this->event = partial_mock('SystemEvent_GIT_GERRIT_ADMIN_KEY_DUMP', array('done', 'error'));
     $this->event->injectDependencies($this->gerrit_server_factory, $this->ssh_key_dumper);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:SystemEvent_GIT_GERRIT_ADMIN_KEY_DUMPTest.php


示例14: setUp

 public function setUp()
 {
     parent::setUp();
     $this->ssh = partial_mock('Git_Driver_Gerrit_RemoteSSHCommand', array('sshExec'));
     $this->logger = mock('Logger');
     $this->ssh->__construct($this->logger);
     $this->config = new Git_RemoteServer_GerritServer(1, $this->host, $this->ssh_port, $this->http_port, $this->login, $this->identity_file, $this->replication_key, $this->use_ssl, $this->gerrit_version, $this->http_password);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:RemoteSSHCommandTest.php


示例15: setUp

 public function setUp()
 {
     parent::setUp();
     $this->tracker_id = 12;
     $this->tracker = aTracker()->withId($this->tracker_id)->build();
     $this->user_id = 32;
     $this->user = aUser()->withId($this->user_id)->build();
     $this->report_factory = partial_mock('Tracker_ReportFactory', array('getReportsByTrackerId'));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:Tracker_ReportFactoryTest.php


示例16: itCreatesSemantic

 /**
  * Not exactly a unit test but, then again, we are testing a plugin!
  */
 public function itCreatesSemantic()
 {
     $effort_factory = partial_mock('AgileDashboard_Semantic_InitialEffortFactory', array());
     $plugin = partial_mock('AgileDashboardPlugin', array('getSemanticInitialEffortFactory'));
     stub($plugin)->getSemanticInitialEffortFactory()->returns($effort_factory);
     $plugin->tracker_event_semantic_from_xml($this->parameters);
     $this->assertNotNull($this->parameters['semantic']);
     $this->assertIsA($this->parameters['semantic'], 'AgileDashBoard_Semantic_InitialEffort');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:AgileDashboardPluginTest.php


示例17: itSendsJSON

 public function itSendsJSON()
 {
     $response = partial_mock('Response', array('setContentType'));
     stub($response)->setContentType('application/json')->once();
     ob_start();
     $response->sendJSON(array("toto"));
     $output = ob_get_clean();
     $this->assertEqual($output, '["toto"]');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:ResponseTest.php


示例18: testJSon

 public function testJSon()
 {
     $id = 123;
     $label = 'Reopen';
     $value = partial_mock('Tracker_FormElement_Field_List_BindValue', array('getLabel', '__toString'));
     $value->setReturnValue('getLabel', $label);
     $value->setId($id);
     $this->assertEqual(json_encode($value->fetchForOpenListJson()), '{"id":123,"value":"b123","caption":"Reopen","rest_value":"Reopen"}');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:Tracker_FormElement_Field_List_BindValueTest.php


示例19: itHasJsonRepresentation

 public function itHasJsonRepresentation()
 {
     $timestamp = mktime(1, 1, 1, 9, 25, 2013);
     $changeset = partial_mock('Tracker_Artifact_Changeset', array('getChangeContentForJson'), array(15, aMockArtifact()->build(), 45, $timestamp, ''));
     $template_renderer = mock('TemplateRenderer');
     stub($template_renderer)->renderToString()->returns('body');
     $json_formatter = new Tracker_Artifact_ChangesetJsonFormatter($template_renderer);
     $this->assertEqual($json_formatter->format($changeset), array('id' => 15, 'submitted_by' => 45, 'submitted_on' => date('c', $timestamp), 'email' => '', 'html' => 'body'));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:Tracker_Artifact_ChangesetJsonFormatterTest.php


示例20: setUp

 function setUp()
 {
     parent::setUp();
     $GLOBALS['Language']->setReturnValue('getText', 'actions_no_repository_forked', array('plugin_git', 'actions_no_repository_forked', '*'));
     $GLOBALS['Language']->setReturnValue('getText', 'successfully_forked', array('plugin_git', 'successfully_forked', '*'));
     $git_plugin = stub('GitPlugin')->areFriendlyUrlsActivated()->returns(false);
     $url_manager = new Git_GitRepositoryUrlManager($git_plugin);
     $this->gitAction = partial_mock('GitActions', array('getText', 'addData', 'getGitRepository', 'save'), array(mock('Git'), mock('Git_SystemEventManager'), mock('GitRepositoryFactory'), mock('GitRepositoryManager'), mock('Git_RemoteServer_GerritServerFactory'), stub('Git_Driver_Gerrit_GerritDriverFactory')->getDriver()->returns(mock('Git_Driver_Gerrit')), mock('Git_Driver_Gerrit_UserAccountManager'), mock('Git_Driver_Gerrit_ProjectCreator'), mock('Git_Driver_Gerrit_Template_TemplateFactory'), mock('ProjectManager'), mock('GitPermissionsManager'), $url_manager, mock('Logger'), mock('Git_Backend_Gitolite'), mock('Git_Mirror_MirrorDataMapper'), mock('ProjectHistoryDao'), mock('GitRepositoryMirrorUpdater')));
 }
开发者ID:blestab,项目名称:tuleap,代码行数:9,代码来源:GitActionsTest.php



注:本文中的partial_mock函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pass函数代码示例发布时间:2022-05-15
下一篇:
PHP partial_exists函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap