FOSSology  4.4.0
Open Source License Compliance by Open Source Software
testCleanUp.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
18 require_once ('fossologyTestCase.php');
19 require_once ('TestEnvironment.php');
20 
21 global $URL;
22 
24  public $mybrowser;
25  public $webProxy;
26 
27  function setUp() {
28  global $URL;
29  $this->Login();
30  }
31 
32  function testRmTestingFolders() {
33  global $URL;
34 
35  $folderList = array('Basic-Testing',
36  'Testing',
37  'Agent-Test',
38  'SrvUploads',
39  'Enote',
40  'Copyright');
41 
42  print "Removing Testing folders\n";
43  $page = $this->mybrowser->get($URL);
44  foreach($folderList as $folder) {
45  $this->deleteFolder($folder);
46  }
47  }
48 
49  function testRmUploads() {
50 
51  print "Removing ALL uploads in the root folder\n";
52  $tr = TESTROOT;
53  if(!chdir(TESTROOT)) {
54  print "ERROR! could not cd to $tr\n";
55  print "please run $tr" . "/cleanRF.php by hand\n";
56  }
57  $uploadLast = exec("fo-runTests cleanRF.php -n 'Clean Root Folder'", $dummy, $Urtn);
58  //print "DB: last line is:$uploadLast\n";
59  //print "DB: results are:\n";print_r($dummy) . "\n";
60  }
61 }
Login($User=NULL, $Password=NULL)