FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
testCleanUp.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  ***********************************************************/
18 
29 require_once ('fossologyTestCase.php');
30 require_once ('TestEnvironment.php');
31 
32 global $URL;
33 
35  public $mybrowser;
36  public $webProxy;
37 
38  function setUp() {
39  global $URL;
40  $this->Login();
41  }
42 
43  function testRmTestingFolders() {
44  global $URL;
45 
46  $folderList = array('Basic-Testing',
47  'Testing',
48  'Agent-Test',
49  'SrvUploads',
50  'Enote',
51  'Copyright');
52 
53  print "Removing Testing folders\n";
54  $page = $this->mybrowser->get($URL);
55  foreach($folderList as $folder) {
56  $this->deleteFolder($folder);
57  }
58  }
59 
60  function testRmUploads() {
61 
62  print "Removing ALL uploads in the root folder\n";
63  $tr = TESTROOT;
64  if(!chdir(TESTROOT)) {
65  print "ERROR! could not cd to $tr\n";
66  print "please run $tr" . "/cleanRF.php by hand\n";
67  }
68  $uploadLast = exec("fo-runTests cleanRF.php -n 'Clean Root Folder'", $dummy, $Urtn);
69  //print "DB: last line is:$uploadLast\n";
70  //print "DB: results are:\n";print_r($dummy) . "\n";
71  }
72 }
73 ?>
Login($User=NULL, $Password=NULL)