FOSSology  4.7.1
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest Class Reference

Tests for LicenseCompatibilityRule model. More...

Inheritance diagram for Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest:
Collaboration graph

Public Member Functions

 testConstructor ()
 
 testFromArray ()
 
 testFromArrayWithFalseCompatibility ()
 
 testSetters ()
 
 testGetArrayV1 ()
 
 testGetArrayV2 ()
 
 testGetJSON ()
 

Private Member Functions

 getRuleRow ()
 Get a rule row as returned by CompatibilityDao. More...
 
 getRule ()
 Get a new model object holding the values of getRuleRow() More...
 

Detailed Description

Tests for LicenseCompatibilityRule model.

Definition at line 22 of file LicenseCompatibilityRuleTest.php.

Member Function Documentation

◆ getRule()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::getRule ( )
private

Get a new model object holding the values of getRuleRow()

Returns
LicenseCompatibilityRule

Definition at line 47 of file LicenseCompatibilityRuleTest.php.

◆ getRuleRow()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::getRuleRow ( )
private

Get a rule row as returned by CompatibilityDao.

Returns
array

Definition at line 28 of file LicenseCompatibilityRuleTest.php.

◆ testConstructor()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::testConstructor ( )
Test:
  1. Test the constructor of LicenseCompatibilityRule

Definition at line 58 of file LicenseCompatibilityRuleTest.php.

◆ testFromArray()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::testFromArray ( )
Test:
  1. Test LicenseCompatibilityRule::fromArray()
  2. Check if the values of the DB row are casted as expected

Definition at line 68 of file LicenseCompatibilityRuleTest.php.

◆ testFromArrayWithFalseCompatibility()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::testFromArrayWithFalseCompatibility ( )
Test:
  1. Test LicenseCompatibilityRule::fromArray() for an incompatible rule
  2. Check if the compatibility is false

Definition at line 90 of file LicenseCompatibilityRuleTest.php.

◆ testGetArrayV1()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::testGetArrayV1 ( )
Test:
  1. Test LicenseCompatibilityRule::getArray() for version 1
  2. Check if the keys are in snake_case

Definition at line 133 of file LicenseCompatibilityRuleTest.php.

◆ testGetArrayV2()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::testGetArrayV2 ( )
Test:
  1. Test LicenseCompatibilityRule::getArray() for version 2
  2. Check if the keys are in camelCase

Definition at line 156 of file LicenseCompatibilityRuleTest.php.

◆ testGetJSON()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::testGetJSON ( )
Test:
  1. Test LicenseCompatibilityRule::getJSON()
  2. Check if the JSON matches the array of the same version

Definition at line 179 of file LicenseCompatibilityRuleTest.php.

◆ testSetters()

Fossology\UI\Api\Test\Models\LicenseCompatibilityRuleTest::testSetters ( )
Test:
  1. Test the setters of LicenseCompatibilityRule
  2. Check if the getters return the new values

Definition at line 104 of file LicenseCompatibilityRuleTest.php.


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