FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
cleanRF.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 
37  function setUp() {
38  global $URL;
39  $this->Login();
40  }
41 
42  function testRmRFContent() {
43  global $URL;
44  print "Removing the content of the root folder (Software Repository)\n";
45  $page = $this->mybrowser->get($URL);
46  $page = $this->mybrowser->clickLink('Delete Uploaded File');
47  $this->assertTrue($this->myassertText($page, '/Select the uploaded file to delete/'),
48  "Could not select an uploaded file, (did not see the text)\n" .
49  "Make sure you are logged in a fossy\n");
50  $SRselect = $this->parseSelectStmnt($page,'upload');
51  //print "SRselect is:\n"; print_r($SRselect) . "\n";
52  if(empty($SRselect)) {
53  $this->pass('Nothing to remove');
54  return;
55  }
56  foreach($SRselect as $uploadName => $uploadId){
57  print "Removing $uploadName...\n";
58  $this->assertTrue($this->mybrowser->setField('upload', $uploadId));
59  $page = $this->mybrowser->clickSubmit('Delete!');
60  $this->assertTrue($page);
61  $this->assertTrue($this->myassertText($page, "/Deletion added to job queue/"),
62  "delete Upload Failed!\nPhrase 'Deletion added to job queue' not found\n");
63  }
64  }
65 }
66 ?>
parseSelectStmnt($page, $selectName, $optionText=NULL)
Login($User=NULL, $Password=NULL)