当前位置: 首页>>代码示例>>PHP>>正文


PHP partial_mock函数代码示例

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


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


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