FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Dao\AgentDaoTest Class Reference
Inheritance diagram for Fossology\Lib\Dao\AgentDaoTest:
Inheritance graph
Collaboration diagram for Fossology\Lib\Dao\AgentDaoTest:
Collaboration graph

Public Member Functions

 testGetCurrentAgent ()
 
 testGetSuccessfulAgentRuns ()
 
 testGetLatestAgentResultForUpload ()
 
 testGetRunningAgentIds ()
 
 testGetRunningAgentIdsForFinishedAgent ()
 
 testGetRunningAgentIdsForUnknownAgent ()
 
 testArsTableExists ()
 
 testArsTableExistsReturnsFalseIfTableDoesNotExist ()
 
 testGetAgentRev ()
 
 testGetAgentName ()
 
 testRenewCurrentAgent ()
 
 testGetCurrentAgentId ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Private Member Functions

 createAgent ($agentId=2)
 

Private Attributes

 $uploadId = 25
 
 $olderAgentId = 3
 
 $otherAgentId = 4
 
 $agentId = 5
 
 $incompleteAgentId = 6
 
 $agentName = "agentName"
 
 $otherAgentName = "otherAgentName"
 
 $agentRev = "<agentRev>"
 
 $olderAgentRev = "<olderAgentRev>"
 
 $otherAgentRev = "<otherAgentRev>"
 
 $incompleteAgentRev = "<incompleteAgentRev>"
 
 $agentDesc = "<agentDesc>"
 
 $otherAgentDesc = "<otherAgentDesc>"
 
 $agentEnabled = true
 
 $testDb
 
 $dbManager
 
 $logger
 
 $agentsDao
 
 $agent
 
 $olderAgent
 
 $otherAgent
 
 $incompleteAgent
 

Detailed Description

Definition at line 16 of file AgentDaoTest.php.

Member Function Documentation

◆ createAgent()

Fossology\Lib\Dao\AgentDaoTest::createAgent (   $agentId = 2)
private

Helper function to create an agent in the database for testing purposes.

Parameters
int$agentIdThe ID to assign to the agent. Defaults to 2.
Returns
int The ID of the created agent.
  1. Inserts a new record into the agent table with the specified ID and attributes.
  2. The inserted record includes fields such as agent_name, agent_rev, agent_desc, and agent_enabled.
  3. Returns the ID of the created agent, which can be used for further testing or assertions.

Definition at line 193 of file AgentDaoTest.php.

◆ testGetAgentName()

Fossology\Lib\Dao\AgentDaoTest::testGetAgentName ( )
Test:
  1. Test to retrieve the name of an agent by its ID AgentsDao::getAgentName()
  2. Create an agent to ensure there is an agent available for the test
  3. Check that the agent name is correctly retrieved and matches the expected value

Definition at line 221 of file AgentDaoTest.php.

◆ testGetAgentRev()

Fossology\Lib\Dao\AgentDaoTest::testGetAgentRev ( )
Test:
  1. Test to retrieve the revision information of an agent by its ID AgentsDao::getAgentRev()
  2. Create an agent to ensure there is an agent available for the test
  3. Check that the agent revision is correctly retrieved and matches the expected value

Definition at line 207 of file AgentDaoTest.php.

◆ testGetCurrentAgentId()

Fossology\Lib\Dao\AgentDaoTest::testGetCurrentAgentId ( )
Test:
  1. Test to retrieve the current agent ID for a specific agent type AgentsDao::getCurrentAgentId()
  2. Ensure an agent is created before fetching the agent ID
  3. Verify that the returned agent ID is not null and matches the expected ID

Definition at line 249 of file AgentDaoTest.php.

◆ testRenewCurrentAgent()

Fossology\Lib\Dao\AgentDaoTest::testRenewCurrentAgent ( )
Test:
  1. Test to renew the current agent for a specific agent type AgentsDao::renewCurrentAgent()
  2. Ensure an agent is created before attempting to renew
  3. Verify that the renewal operation returns a non-null result and is successful

Definition at line 235 of file AgentDaoTest.php.


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