FOSSology  4.7.1
Open Source License Compliance by Open Source Software
Fossology\Decider\DeciderAgentKotobaTest Class Reference

Unit tests for DeciderAgent::autodecideIfKotobaMatchesNoContradiction() More...

Inheritance diagram for Fossology\Decider\DeciderAgentKotobaTest:
Inheritance graph
Collaboration diagram for Fossology\Decider\DeciderAgentKotobaTest:
Collaboration graph

Public Member Functions

 testReturnsFalseWhenNoCurrentEvents ()
 
 testReturnsFalseWhenHumanEventPresent ()
 
 testReturnsFalseWhenBulkEventPresent ()
 
 testConcludesWhenAllScannerLicensesAccountedFor ()
 
 testReturnsFalseWhenScannerFindsUnaccountedLicense ()
 
 testConcludesWhenNoScannerFindings ()
 
 testReturnsFalseWhenMixedKotobaAndHumanEvents ()
 
 testReturnsFalseWhenDecisionProcessorThrows ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Private Member Functions

 makeClearingEvent (int $licenseId, int $eventType, bool $removed=false)
 
 makeScannerMatch (int $licenseId)
 
 makeItemTreeBounds ()
 

Private Attributes

 $deciderAgent
 
 $clearingDecisionProcessor
 
 $licenseMap
 
 $assertCountBefore
 

Detailed Description

Member Function Documentation

◆ makeClearingEvent()

Fossology\Decider\DeciderAgentKotobaTest::makeClearingEvent ( int  $licenseId,
int  $eventType,
bool  $removed = false 
)
private

Build a real ClearingEvent with the given license id and event type.

Definition at line 108 of file DeciderAgentKotobaTest.php.

◆ makeScannerMatch()

Fossology\Decider\DeciderAgentKotobaTest::makeScannerMatch ( int  $licenseId)
private

Build a minimal LicenseMatch with getLicenseId() returning $licenseId.

Definition at line 126 of file DeciderAgentKotobaTest.php.

◆ testConcludesWhenAllScannerLicensesAccountedFor()

Fossology\Decider\DeciderAgentKotobaTest::testConcludesWhenAllScannerLicensesAccountedFor ( )
Test:
User case 1: scanner={MIT=1, GPL=2}; kotoba adds MIT(1), removes GPL(2). Every scanner license is accounted for → concludes → returns true.

Definition at line 194 of file DeciderAgentKotobaTest.php.

◆ testConcludesWhenNoScannerFindings()

Fossology\Decider\DeciderAgentKotobaTest::testConcludesWhenNoScannerFindings ( )
Test:
Kotoba events only, no scanner findings at all → no contradiction → concludes.

Definition at line 260 of file DeciderAgentKotobaTest.php.

◆ testReturnsFalseWhenBulkEventPresent()

Fossology\Decider\DeciderAgentKotobaTest::testReturnsFalseWhenBulkEventPresent ( )
Test:
A BULK event is present → must not auto-conclude → false.

Definition at line 177 of file DeciderAgentKotobaTest.php.

◆ testReturnsFalseWhenDecisionProcessorThrows()

Fossology\Decider\DeciderAgentKotobaTest::testReturnsFalseWhenDecisionProcessorThrows ( )
Test:
ClearingDecisionProcessor throws an exception → method returns false gracefully.

Definition at line 302 of file DeciderAgentKotobaTest.php.

◆ testReturnsFalseWhenHumanEventPresent()

Fossology\Decider\DeciderAgentKotobaTest::testReturnsFalseWhenHumanEventPresent ( )
Test:
A single human (USER) event is present → must not auto-conclude → false.

Definition at line 161 of file DeciderAgentKotobaTest.php.

◆ testReturnsFalseWhenMixedKotobaAndHumanEvents()

Fossology\Decider\DeciderAgentKotobaTest::testReturnsFalseWhenMixedKotobaAndHumanEvents ( )
Test:
Mixed events: one kotoba + one human event → bail immediately, false.

Definition at line 281 of file DeciderAgentKotobaTest.php.

◆ testReturnsFalseWhenNoCurrentEvents()

Fossology\Decider\DeciderAgentKotobaTest::testReturnsFalseWhenNoCurrentEvents ( )
Test:
No clearing events → nothing to conclude → returns false.

Definition at line 147 of file DeciderAgentKotobaTest.php.

◆ testReturnsFalseWhenScannerFindsUnaccountedLicense()

Fossology\Decider\DeciderAgentKotobaTest::testReturnsFalseWhenScannerFindsUnaccountedLicense ( )
Test:
User case 2: scanner={MIT=1, GPL=2, MPL=3}; kotoba adds MIT(1), removes GPL(2). MPL(3) is NOT accounted for → contradiction → returns false, no decision made.

Definition at line 228 of file DeciderAgentKotobaTest.php.


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