本文整理汇总了PHP中TuleapTestCase::getTmpDir方法的典型用法代码示例。如果您正苦于以下问题:PHP TuleapTestCase::getTmpDir方法的具体用法?PHP TuleapTestCase::getTmpDir怎么用?PHP TuleapTestCase::getTmpDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TuleapTestCase
的用法示例。
在下文中一共展示了TuleapTestCase::getTmpDir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
$package_factory = new FRSPackageFactoryMock();
$release_factory = new FRSReleaseFactory();
$file_factory = new FRSXMLImporterTest_FRSFileFactory();
$this->package_dao = mock('FRSPackageDao');
$package_factory->dao = $this->package_dao;
FRSPackageFactory::setInstance($package_factory);
$this->permissions_manager = mock('PermissionsManager');
PermissionsManager::setInstance($this->permissions_manager);
$this->release_dao = mock('FRSReleaseDao');
$release_factory->dao = $this->release_dao;
$release_factory->package_factory = $package_factory;
$release_factory->file_factory = $file_factory;
FRSReleaseFactory::setInstance($release_factory);
$this->file_dao = mock('FRSFileDao');
$file_factory->dao = $this->file_dao;
$file_factory->release_factory = $release_factory;
$this->processor_dao = mock('FRSProcessorDao');
$this->filetype_dao = mock('FRSFileTypeDao');
$this->user_finder = mock('User\\XML\\Import\\IFindUserFromXMLReference');
$this->user_manager = mock('UserManager');
UserManager::setInstance($this->user_manager);
$this->ugroup_dao = mock("UGroupDao");
stub($this->ugroup_dao)->searchByGroupIdAndName()->returns(new DataAccessResultEmpty());
$this->frs_importer = new FRSXMLImporter(mock('Logger'), new XML_RNGValidator(), $package_factory, $release_factory, $file_factory, $this->user_finder, new UGroupManager($this->ugroup_dao), $this->processor_dao, $this->filetype_dao);
EventManager::setInstance(mock('EventManager'));
$GLOBALS['Language'] = mock('BaseLanguage');
if (isset($GLOBALS['ftp_incoming_dir'])) {
$this->old_ftp_incoming_dir = $GLOBALS['ftp_incoming_dir'];
}
if (isset($GLOBALS['old_ftp_frs_dir_prefix'])) {
$this->old_ftp_frs_dir_prefix = $GLOBALS['ftp_frs_dir_prefix'];
}
$GLOBALS['ftp_incoming_dir'] = parent::getTmpDir();
$GLOBALS['ftp_frs_dir_prefix'] = parent::getTmpDir();
}
示例2: import
private function import($xml)
{
return $this->importer->import($this->project, mock('PFUSer'), $xml, parent::getTmpDir());
}
示例3: itShouldImportSvnAccessFile
public function itShouldImportSvnAccessFile()
{
$project = new Project(array('group_id' => 123, 'unix_group_name' => 'test_project'));
$access_file = "[groups]\nmembers = usernameTOTO123\n\n\n[/]\n* = r\n@members = rw\n";
$xml_document = <<<XML
<project>
<svn>
<access-file>{$access_file}</access-file>
</svn>
</project>
XML;
$this->importer->import($project, new SimpleXMLElement($xml_document), parent::getTmpDir());
$dao = $this->svn_accessfile_dao;
$dao->expectCallCount('saveNewAccessFileVersionInProject', 1);
$dao->expectAt(0, 'saveNewAccessFileVersionInProject', array(123, $access_file));
$svnroot = $project->getSVNRootPath();
$accessfile = "{$svnroot}/.SVNAccessFile";
$found = strstr(file_get_contents($accessfile), "TOTO123") !== false;
$this->assertTrue($found);
}
示例4: itShouldImportNotifications
public function itShouldImportNotifications()
{
$project = new Project(array('group_id' => 123, 'unix_group_name' => 'test_project'));
$xml_document = <<<XML
<project>
<svn>
<notification path="/trunk" emails="test1@domain1, test2@domain2"/>
<notification path="/tags" emails="tags@domain3"/>
</svn>
</project>
XML;
$res = $this->importer->import($project, new SimpleXMLElement($xml_document), parent::getTmpDir());
$this->assertTrue($res);
$dao = $this->svn_notification_dao;
$dao->expectAt(0, 'setSvnMailingList', array(123, "test1@domain1, test2@domain2", "/trunk"));
$dao->expectAt(1, 'setSvnMailingList', array(123, "tags@domain3", "/tags"));
$dao->expectCallCount('setSvnMailingList', 2);
}