FOSSology  4.4.0
Open Source License Compliance by Open Source Software
uploadUnpack.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2010 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
22 require_once ('fossologyTestCase.php');
23 require_once ('TestEnvironment.php');
24 
25 global $URL;
26 global $PROXY;
27 
29 {
30  public $mybrowser;
31  public $webProxy;
32 
33  function setUp()
34  {
35  global $URL;
36  $this->Login();
37  }
38 
43  {
44  global $URL;
45  print "Creating Code Coveragefolder\n";
46  $page = $this->mybrowser->get($URL);
47  $this->createFolder(null, 'Code Coverage', null);
48  }
49 
50  function testuploadUnpack() {
51 
52  global $URL;
53  global $PROXY;
54 
55  print "starting testuploadUnpack\n";
56  $rootFolder = 1;
57  $upload = NULL;
58  $uploadList = array('TestData/archives/eddyData.tar.bz2',
59  'TestData/archives/foss23D1F1L.tar.bz2',
60  'TestData/licenses/gplv2.1',
61  'TestData/licenses/Affero-v1.0');
62  $urlList = array('http://downloads.sourceforge.net/simpletest/simpletest_1.0.1.tar.gz',
63  'http://www.gnu.org/licenses/gpl-3.0.txt',
64  'http://www.gnu.org/licenses/agpl-3.0.txt',
65  'http://osrb-1.fc.hp.com/~fosstester/fossology_1.1.1~20100622_all.deb');
66 
67  print "Starting file uploads\n";
68  foreach($uploadList as $upload) {
69  $description = "File $upload uploaded by Upload Test Data Test";
70  $this->uploadFile('Testing', $upload, $description, null, NULL);
71  }
72 
73  /* Upload the urls using upload from url. Check if the user specificed a
74  * web proxy for the environment. If so, set the attribute. */
75 
76  if(!(empty($PROXY)))
77  {
78  $this->webProxy = $PROXY;
79  }
80  print "Starting Url uploads\n";
81  foreach($urlList as $url)
82  {
83  $this->uploadUrl($rootFolder, $url, null, null, NULL);
84  }
85  }
86 }
uploadUrl($parentFolder, $url, $description=null, $uploadName=null, $agents=null)
uploadFile($parentFolder, $uploadFile, $description=null, $uploadName=null, $agents=null)
createFolder($parent, $name, $description=null)
Login($User=NULL, $Password=NULL)
testCreateTestingFolder()