FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
uploadWoutEmail.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  ***********************************************************/
30 require_once ('../../../tests/fossologyTestCase.php');
31 require_once ('../../../tests/TestEnvironment.php');
32 
33 global $URL;
34 
36 
37  public $mybrowser;
38 
39  public function setUp() {
40  global $URL;
41  $last = exec('./changeENV.php -s fosstester -c noemail', $out, $rtn);
42  if($rtn > 0) {
43  $this->fail("Could not change the test environment file, stopping test\n");
44  print "Failure, output from changeENV is:\n";print_r($out) . "\n";
45  exit(1);
46  }
47  $this->Login();
48  //$this->Login();
49  $result = $this->createFolder(1, 'Enote', 'Folder for Email notification uploads');
50  if(!is_null($result)) {
51  if($result != 'Folder Enote Exists') {
52  $this->fail("Failure! folder Enote does not exist, stopping test\n");
53  exit(1);
54  }
55  }
56  }
57 
58  public function testUploadWoutEmail() {
59 
60  global $URL;
61 
62  /* login noemail */
63  print "Starting upload without email notificiation\n";
64  $page = $this->mybrowser->get($URL);
65 
66  $File = '/home/fosstester/licenses/gplv2.1';
67  $Filedescription = "The GPL Version 2.1 from the gnu.org site";
68 
69  $Url = 'http://www.gnu.org/licenses/gpl.txt';
70  $Urldescription = "The GPL Version 3.0 June 2007 from www.gnu.org/licenses/gpl.txt";
71 
72  $Srv = '/home/fosstester/licenses/zlibLicense-1.2.2-2004-Oct-03';
73  $Srvdescription = "zlib license from http://www.gzip.org/zlib/zlib_license.html";
74 
75  $this->uploadFile('Enote', $File, $Filedescription, null, '1');
76  $this->uploadUrl('Enote', $Url, $Urldescription, null, '2');
77  $this->uploadServer('Enote', $Srv, $Srvdescription, null, 'all');
78 
79  /*
80  * need to check email when they finish....
81  */
82  print "waiting for jobs to finish\n";
83  $this->wait4jobs();
84  print "verifying NO email was received\n";
85  $this->checkEmailNotification(0);
86  }
87 
88  public function tearDown() {
89  print "Changing user back to fosstester";
90  $last = exec('./changeENV.php -s noemail -c fosstester', $out, $rtn);
91  if($rtn > 0) {
92  $this->fail("Could not change the test environment file, stopping test\n");
93  print "Failure, output from changeENV is:\n";print_r($out) . "\n";
94  exit(1);
95  }
96  }
97 };
98 ?>
createFolder($parent=null, $name, $description=null)
uploadFile($parentFolder, $uploadFile, $description=null, $uploadName=null, $agents=null)
uploadUrl($parentFolder=1, $url, $description=null, $uploadName=null, $agents=null)
Login($User=NULL, $Password=NULL)
uploadServer($parentFolder=1, $uploadPath, $description=null, $uploadName=null, $agents=null)