21 require_once (
'../../../tests/fossologyTestCase.php');
22 require_once (
'../../../tests/TestEnvironment.php');
39 $page = $this->mybrowser->get(
"$URL?mod=folder_create");
40 $this->assertTrue($this->myassertText($page,
'/Create a new Fossology folder/'));
42 $FolderId = $this->
getFolderId(
'Basic-Testing', $page,
'parentid');
43 $this->assertTrue($this->mybrowser->setField(
'parentid', $FolderId));
45 $this->assertTrue($this->mybrowser->setField(
'newname', $this->folder_name));
46 $desc =
'Folder created by DeleteFolderTest as subfolder of Testing';
47 $this->assertTrue($this->mybrowser->setField(
'description',
"$desc"));
48 $page = $this->mybrowser->clickSubmit(
'Create!');
49 $this->assertTrue($page);
50 $this->assertTrue($this->myassertText($page,
"/Folder $this->folder_name Created/"),
51 "FAIL! Folder $this->folder_name Created not found\n");
54 function testDeleteFolder()
58 print
"starting DeleteFoldertest\n";
60 $loggedIn = $this->mybrowser->get($URL);
61 $this->assertTrue($this->myassertText($loggedIn,
'/Organize/'),
62 "FAIL! Could not find Organize menu\n");
63 $this->assertTrue($this->myassertText($loggedIn,
'/Folders /'));
64 $this->assertTrue($this->myassertText($loggedIn,
'/Delete Folder/'));
68 $page = $this->mybrowser->get(
"$URL?mod=admin_folder_delete");
69 $this->assertTrue($this->myassertText($page,
'/Delete Folder/'));
70 $FolderId = $this->
getFolderId(
'DeleteMe', $page,
'folder');
71 $this->assertTrue($this->mybrowser->setField(
'folder', $FolderId));
72 $page = $this->mybrowser->clickSubmit(
'Delete!');
73 $this->assertTrue($page);
74 $this->assertTrue($this->myassertText($page,
"/Deletion of folder $this->folder_name/"),
75 "FAIL! Deletion of $this->folder_name not found\n");
78 $page = $this->mybrowser->get(
"$URL?mod=browse");
79 $this->assertFalse($this->myassertText($page,
'/DeleteMe/'),
80 "NOTE: Folder DeleteMe still exists after 120 seconds");
getFolderId($folderName, $page, $selectName)
Login($User=NULL, $Password=NULL)