FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Dao\PfileDaoTest Class Reference

Test cases for PfileDao. More...

Inheritance diagram for Fossology\Lib\Dao\PfileDaoTest:
Inheritance graph
Collaboration diagram for Fossology\Lib\Dao\PfileDaoTest:
Collaboration graph

Public Member Functions

 testGetPfile ()
 
 testGetScannerFindings ()
 
 testGetUploadForPackage ()
 
 testGetConclusions ()
 
 testGetCopyright ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Private Attributes

 $testDb
 
 $dbManager
 
 $logger
 
 $pfileDao
 
 $assertCountBefore
 

Detailed Description

Test cases for PfileDao.

Definition at line 26 of file PfileDaoTest.php.

Member Function Documentation

◆ setUp()

Fossology\Lib\Dao\PfileDaoTest::setUp ( )
protected

Setup test DB and other objects

See also
PHPUnit::Framework::TestCase::setUp()

Definition at line 48 of file PfileDaoTest.php.

◆ tearDown()

Fossology\Lib\Dao\PfileDaoTest::tearDown ( )
protected

Tear down test DB and objects

See also
PHPUnit::Framework::TestCase::tearDown()

Definition at line 61 of file PfileDaoTest.php.

◆ testGetConclusions()

Fossology\Lib\Dao\PfileDaoTest::testGetConclusions ( )
Test:
  1. Test for PfileDao::getConclusions()
  2. Setup test data from SPDX test data
  3. Get conclusion for pfile with given group
  4. Get conclusion for pfile with different group for global decisions
  5. Not found result should be empty array

Definition at line 193 of file PfileDaoTest.php.

◆ testGetCopyright()

Fossology\Lib\Dao\PfileDaoTest::testGetCopyright ( )
Test:
  1. Test for PfileDao::getCopyright()
  2. Setup required tables and data
  3. Fetch results for different pfiles with 1 or 2 results
  4. Make sure the license list is sorted
  5. Not found results should be empty array

Definition at line 224 of file PfileDaoTest.php.

◆ testGetPfile()

Fossology\Lib\Dao\PfileDaoTest::testGetPfile ( )
Test:
  1. Test for PfileDao::getPfile()
  2. Fetch multiple pfiles by various input combinations of checksums
  3. Also, the case of checksum should not effect the results
  4. Unavailable pfiles should be returned as null

Definition at line 77 of file PfileDaoTest.php.

◆ testGetScannerFindings()

Fossology\Lib\Dao\PfileDaoTest::testGetScannerFindings ( )
Test:
  1. Test for PfileDao::getScannerFindings()
  2. Setup required tables and data
  3. Fetch results for different pfiles with 1 or 2 results
  4. Make sure the license list is sorted
  5. Not found results should be empty array

Definition at line 132 of file PfileDaoTest.php.

◆ testGetUploadForPackage()

Fossology\Lib\Dao\PfileDaoTest::testGetUploadForPackage ( )
Test:
  1. Test for PfileDao::getUploadForPackage()
  2. Check if corrects uploads are returned
  3. Not found result should be null

Definition at line 167 of file PfileDaoTest.php.

Member Data Documentation

◆ $assertCountBefore

integer Fossology\Lib\Dao\PfileDaoTest::$assertCountBefore
private

Mock asserts

Definition at line 42 of file PfileDaoTest.php.

◆ $dbManager

DbManager Fossology\Lib\Dao\PfileDaoTest::$dbManager
private

DbManager

Definition at line 33 of file PfileDaoTest.php.

◆ $logger

Logger Fossology\Lib\Dao\PfileDaoTest::$logger
private

Logger

Definition at line 36 of file PfileDaoTest.php.

◆ $pfileDao

PfileDao Fossology\Lib\Dao\PfileDaoTest::$pfileDao
private

Pfile dao

Definition at line 39 of file PfileDaoTest.php.

◆ $testDb

TestPgDb Fossology\Lib\Dao\PfileDaoTest::$testDb
private

Test Db

Definition at line 30 of file PfileDaoTest.php.


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