FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
moveUploadTest.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  ***********************************************************/
28 require_once ('../../../tests/fossologyTestCase.php');
29 require_once ('../../../tests/TestEnvironment.php');
30 
31 global $URL;
43 {
44  public $upload2Move;
45  public $fromFolder='root';
46  public $toFolder;
47  public $mybrowser;
48 
49  function setUp()
50  {
51  //print "starting setUp moveUploadTest\n";
52  $this->Login();
53  }
61  function testMoveUpload()
62  {
63  global $URL;
64 
65  print "starting MoveUploadtest\n";
66  $loggedIn = $this->mybrowser->get($URL);
67  $this->assertTrue($this->myassertText($loggedIn, '/Organize/'),
68  "FAIL! Could not find Organize menu\n");
69  $this->assertTrue($this->myassertText($loggedIn, '/Uploads /'),
70  "testMoveUpload FAILED! coun not find Uploads menu\n");
71  /* this assertion below is bogus, there are multiple Move (s) */
72  $this->assertTrue($this->myassertText($loggedIn, '/Move/'));
73  $this->upload2Move = 'gpl-3.0.txt';
74  $this->toFolder = 'Basic-Testing';
75  /* fromFolder is 'root' */
76  $this->moveUpload($this->fromFolder, $this->toFolder, $this->upload2Move);
77  /* best we can do with simpletest is to see if the folder is still there.
78  *
79  */
80  $page = $this->mybrowser->clickLink('Browse');
81  $page = $this->mybrowser->clickLink('Basic-Testing');
82  $this->assertTrue($this->myassertText($page, "/$this->upload2Move/"),
83  "moveUploadTest FAILED! Folder $this->upload2Move does not exist under Basic-Testing folder\n");
84  //print "************ page after Move! *************\n$page\n";
85  }
86 
87  /*
88  * move the upload back to root folder so the test can be run
89  * multiple times.
90  */
91  function tearDown()
92  {
93  $this->moveUpload('Basic-Testing', 'root', $this->upload2Move);
94  }
95 }
96 ?>
Login($User=NULL, $Password=NULL)
moveUpload($oldFolder, $destFolder, $upload)