FOSSology  4.4.0
Open Source License Compliance by Open Source Software
fossologyTest Class Reference
Inheritance diagram for fossologyTest:
Inheritance graph
Collaboration diagram for fossologyTest:
Collaboration graph

Public Member Functions

 getBrowser ()
 
 getCookie ()
 
 getPassword ()
 
 getUser ()
 
 setBrowser ($browser)
 
 setmyCookie ($cookie)
 
 setPassword ($password)
 
 setUser ($user)
 
 pmm ($test)
 
 plt ($test)
 
 createTestFolder ($name, $parent='root')
 
 getFolderId ($folderName, $page, $selectName)
 
 getUploadId ($uploadName, $page, $selectName)
 
 Login ($User=NULL, $Password=NULL)
 
 Logout ($User=NULL)
 
 myassertText ($page, $pattern)
 
 parseSelectStmnt ($page, $selectName, $optionText=NULL)
 
 parseFossjobs ($all=NULL)
 
 setAgents ($agents=NULL)
 

Public Attributes

 $mybrowser
 
 $cookie
 
 $debug
 

Protected Member Functions

 _browser ()
 
 getSelectAttr ($page, $selectName)
 
 setSelectAttr ($page, $selectName, $attribute, $value=NULL)
 

Protected Attributes

 $User = NULL
 

Private Member Functions

 _repoDBlogin ($browser=NULL)
 
 __chopPage ($page)
 

Private Attributes

 $Url
 
 $Password = NULL
 

Detailed Description

Base clase for fossologyTestCase. Most FOSSology tests should not extend this class. Extend fossologyTestCase instead.

Only put methods in here that more than one fossologyTestCase can use.

Author
markd

Definition at line 40 of file fossologyTest.php.

Member Function Documentation

◆ __chopPage()

fossologyTest::__chopPage (   $page)
private

__chopPage

return the last 1.5K characters of the string, useful for just looking at the end of a returned page.

Parameters
string$page
Returns
string

Definition at line 690 of file fossologyTest.php.

◆ _browser()

fossologyTest::_browser ( )
protected

_browser

internal method (singleton?) to make sure only one browser per test run is being used.

Returns
resource

TODO: fix returns so it's either a resource or ??

Definition at line 98 of file fossologyTest.php.

◆ createTestFolder()

fossologyTest::createTestFolder (   $name,
  $parent = 'root' 
)

createTestingFolder

Create a folder for use in testing

Parameters
string$namethe name of the folder to create
string$parentthe name of the parent folder. This is an optoinal parameter, if none supplied, then the root folder is used.
Returns
boolean

Definition at line 126 of file fossologyTest.php.

◆ getFolderId()

fossologyTest::getFolderId (   $folderName,
  $page,
  $selectName 
)

getFolderId

parse the folder id out of the select statement

Parameters
string$folderNamethe name of the folder
string$pagethe xhtml page to search
string$selectNamethe name attribute of the select statement to parse
Returns
int $FolderId, NULL on error

Definition at line 150 of file fossologyTest.php.

◆ getSelectAttr()

fossologyTest::getSelectAttr (   $page,
  $selectName 
)
protected

getSelectAttr

get select attributes.

Parameters
string$pagethe page to parse
string$selectNamethe name of the select,
Returns
array an array of the attributes, with the attributes as the keys. NULL on errror.

Definition at line 594 of file fossologyTest.php.

◆ getUploadId()

fossologyTest::getUploadId (   $uploadName,
  $page,
  $selectName 
)

getUploadId($uploadName, $page, $selectName)

parse the folder id out of the select in the $page

Parameters
string$uploadNamethe name of the upload
string$pagethe xhtml page to search
string$selectNamethe name attribute of the select statement to parse
Returns
int $uploadId or NULL on errro

Definition at line 188 of file fossologyTest.php.

◆ Login()

fossologyTest::Login (   $User = NULL,
  $Password = NULL 
)

Login to the FOSSology Repository, uses the globals set in TestEnvironment.php as the default or the user and password supplied.

Parameters
string$Userthe fossology user name
string$Passwordthe fossology user password

Definition at line 214 of file fossologyTest.php.

◆ Logout()

fossologyTest::Logout (   $User = NULL)

Logout of the FOSSology Repository, uses the globals set in TestEnvironment.php as the default or the user and password supplied.

Parameters
string$Userthe fossology user name

Definition at line 252 of file fossologyTest.php.

◆ parseFossjobs()

fossologyTest::parseFossjobs (   $all = NULL)

function parseFossjobs

parse the output of fossjobs command, return an array with the information

With no parameters parseFossnobs will return an associative array with the last uploads done on each file. The array key is the filename, and upload Id is the value. The array is reverse sorted by upload (newest uploads 1st).

With the all parameter, all of the uploads are returned in an associative array. The keys are the upload id's in assending order, the filename uploaded is the value.

Parameters
boolean$all,indicatesall uploads are wanted.
Returns
associative array

Definition at line 460 of file fossologyTest.php.

◆ parseSelectStmnt()

fossologyTest::parseSelectStmnt (   $page,
  $selectName,
  $optionText = NULL 
)

parseSelectStmnt

Parse the specified select statement on the page

Parameters
string$pagethe page to search
string$selectNamethe name of the select
string$optionTextthe text of the option statement
Returns
mixed $select either array (if first two args present) or int if all three arguments present. NULL on error.

Format of the array returned:

Array[option text]=>[option value attribute]

Definition at line 364 of file fossologyTest.php.

◆ setAgents()

fossologyTest::setAgents (   $agents = NULL)

function setAgents

Set 0 or more agents

Assumes it is on a page where agents can be selected with checkboxes. Will produce test errors if it is not.

Parameters
string$agentsa comma seperated list of number 1-4 or all. e.g. 1 1,2 1,4 4,3 all
Returns
NULL, or string on error

Definition at line 509 of file fossologyTest.php.

◆ setSelectAttr()

fossologyTest::setSelectAttr (   $page,
  $selectName,
  $attribute,
  $value = NULL 
)
protected

setSelectAttr

set select attributes.

Parameters
string$pagethe page to parse
string$selectNamethe name of the select
string$attributethe name of the attribute to change, if the attribute is not already set, this method will not set it.
string$valuethe value for the attribute
Returns
TRUE on success, NULL on error

Definition at line 643 of file fossologyTest.php.


The documentation for this class was generated from the following file: