Unit tests for LicenseController.
More...
Unit tests for LicenseController.
Definition at line 46 of file LicenseControllerTest.php.
◆ getDaoLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getDaoLicense |
( |
|
$shortname | ) |
|
|
private |
◆ getDaoObligation()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getDaoObligation |
( |
|
$id | ) |
|
|
private |
◆ getDummyVars()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getDummyVars |
( |
| ) |
|
- # Function helping to store more data and provide a single point of access without repeating ourselves.
- Returns
- array
Definition at line 1417 of file LicenseControllerTest.php.
◆ getEmptyRequest()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getEmptyRequest |
( |
|
$method | ) |
|
◆ getLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getLicense |
( |
|
$shortname, |
|
|
|
$obligations = false , |
|
|
|
$emptyObligation = true |
|
) |
| |
|
private |
◆ getLicenseArgs()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getLicenseArgs |
( |
| ) |
|
◆ getObligation()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getObligation |
( |
|
$id | ) |
|
|
private |
◆ getRequestWithBody()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getRequestWithBody |
( |
|
$method, |
|
|
|
$body |
|
) |
| |
◆ getResponseJson()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::getResponseJson |
( |
|
$response | ) |
|
|
private |
◆ setUp()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::setUp |
( |
| ) |
|
|
protected |
◆ tearDown()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::tearDown |
( |
| ) |
|
|
protected |
◆ testCreateDuplicateLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testCreateDuplicateLicense |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testCreateDuplicateLicenseV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testCreateDuplicateLicenseV1 |
( |
| ) |
|
◆ testCreateDuplicateLicenseV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testCreateDuplicateLicenseV2 |
( |
| ) |
|
◆ testCreateLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testCreateLicense |
( |
| ) |
|
◆ testCreateLicenseNoAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testCreateLicenseNoAdmin |
( |
| ) |
|
◆ testCreateLicenseNoShort()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testCreateLicenseNoShort |
( |
| ) |
|
◆ testDeleteAdminLicenseCandidateIsAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testDeleteAdminLicenseCandidateIsAdmin |
( |
| ) |
|
- Test:
- Test for LicenseController::deleteAdminLicenseCandidate() to delete license-candidate.
- User is admin
- License-candidate is does exist
- Check if response is 200
- Check if response-body matches
Definition at line 994 of file LicenseControllerTest.php.
◆ testDeleteAdminLicenseCandidateNotAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testDeleteAdminLicenseCandidateNotAdmin |
( |
| ) |
|
- Test:
- Test for LicenseController::deleteAdminLicenseCandidate() to delete license-candidate.
- User is not-admin
- License-candidate is does exist
- Check if response is 400
- Check if response-body matches
Definition at line 1018 of file LicenseControllerTest.php.
◆ testDeleteAdminLicenseCandidateNotFound()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testDeleteAdminLicenseCandidateNotFound |
( |
| ) |
|
- Test:
- Test for LicenseController::deleteAdminLicenseCandidate() to delete license-candidate.
- User is admin
- License-candidate don't exist
- Check if response is 404
- Check if rseponse-body matches
Definition at line 1036 of file LicenseControllerTest.php.
◆ testExportAdminLicenseToCSV()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testExportAdminLicenseToCSV |
( |
| ) |
|
◆ testExportAdminLicenseToCSVNotAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testExportAdminLicenseToCSVNotAdmin |
( |
| ) |
|
◆ testGetAllAdminAcknowledgements()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllAdminAcknowledgements |
( |
| ) |
|
◆ testGetAllAdminAcknowledgementsNotAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllAdminAcknowledgementsNotAdmin |
( |
| ) |
|
◆ testGetAllLicenseBounds()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseBounds |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testGetAllLicenseBoundsV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseBoundsV1 |
( |
| ) |
|
◆ testGetAllLicenseBoundsV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseBoundsV2 |
( |
| ) |
|
◆ testGetAllLicenseFilters()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseFilters |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testGetAllLicenseFiltersV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseFiltersV1 |
( |
| ) |
|
◆ testGetAllLicenseFiltersV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseFiltersV2 |
( |
| ) |
|
◆ testGetAllLicenseStandardComments()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseStandardComments |
( |
| ) |
|
◆ testGetAllLicenseV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseV1 |
( |
| ) |
|
◆ testGetAllLicenseV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetAllLicenseV2 |
( |
| ) |
|
◆ testGetCandidatesNoAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetCandidatesNoAdmin |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testGetCandidatesNoAdminV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetCandidatesNoAdminV1 |
( |
| ) |
|
- Test:
- Test for LicenseController::getCandidates() as a non-admin user with version 1 attributes
- Check if status is 403
Definition at line 2165 of file LicenseControllerTest.php.
◆ testGetCandidatesNoAdminV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetCandidatesNoAdminV2 |
( |
| ) |
|
- Test:
- Test for LicenseController::getCandidates() as a non-admin user with version 2 attributes
- Check if status is 403
Definition at line 2174 of file LicenseControllerTest.php.
◆ testGetCandidatesV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetCandidatesV1 |
( |
| ) |
|
- Test:
- Test for LicenseController::getCandidates() for version 1
- Check if status is 200
- Check if response-body matches
Definition at line 2130 of file LicenseControllerTest.php.
◆ testGetCandidatesV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetCandidatesV2 |
( |
| ) |
|
- Test:
- Test for LicenseController::getCandidates() for version 2
- Check if status is 200
- Check if response-body matches
Definition at line 2140 of file LicenseControllerTest.php.
◆ testGetLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetLicense |
( |
| ) |
|
◆ testGetLicenseNotFound()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetLicenseNotFound |
( |
| ) |
|
◆ testGetLicenseObligations()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetLicenseObligations |
( |
| ) |
|
◆ testGetSuggestedLicensesNotAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetSuggestedLicensesNotAdmin |
( |
| ) |
|
- Test:
- Test LicenseController::getSuggestedLicense()
- # Check is the HttpForbiddenException is thrown for unauthorized users
- Returns
- void
- Exceptions
-
Definition at line 2060 of file LicenseControllerTest.php.
◆ testGetSuggestedLicenseWithBadRequest()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testGetSuggestedLicenseWithBadRequest |
( |
| ) |
|
- Test:
- Test LicenseController::getSuggestedLicense()
- # Check if the status is 200
- # Check if the actual and expected response bodies match
- Returns
- void
- Exceptions
-
Definition at line 2076 of file LicenseControllerTest.php.
◆ testHandleAdminLicenseAcknowledgementBadRequest()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleAdminLicenseAcknowledgementBadRequest |
( |
| ) |
|
◆ testHandleAdminLicenseAcknowledgementCreateNew()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleAdminLicenseAcknowledgementCreateNew |
( |
| ) |
|
◆ testHandleAdminLicenseAcknowledgementInvalidBody()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleAdminLicenseAcknowledgementInvalidBody |
( |
| ) |
|
◆ testHandleAdminLicenseAcknowledgementLicenseExists()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleAdminLicenseAcknowledgementLicenseExists |
( |
| ) |
|
◆ testHandleAdminLicenseAcknowledgementWithNoPermission()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleAdminLicenseAcknowledgementWithNoPermission |
( |
| ) |
|
◆ testHandleAdminLicenseAcknowledgementWithUpdate()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleAdminLicenseAcknowledgementWithUpdate |
( |
| ) |
|
◆ testHandleLicenseStandardComment()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleLicenseStandardComment |
( |
| ) |
|
◆ testHandleLicenseStandardCommentCreateNew()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleLicenseStandardCommentCreateNew |
( |
| ) |
|
◆ testHandleLicenseStandardCommentExists()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleLicenseStandardCommentExists |
( |
| ) |
|
◆ testHandleLicenseStandardCommentNoPermission()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleLicenseStandardCommentNoPermission |
( |
| ) |
|
◆ testHandleLicenseStandardCommentWithInvalidBody()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleLicenseStandardCommentWithInvalidBody |
( |
| ) |
|
◆ testHandleLicenseStandardCommentWithUpdate()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testHandleLicenseStandardCommentWithUpdate |
( |
| ) |
|
◆ testImportLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testImportLicense |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testImportLicenseV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testImportLicenseV1 |
( |
| ) |
|
@runInSeparateProcess @preserveGlobalState disabled
- Test:
- Test for LicenseController::handleImportLicense() for version 1
- Check if response status is 200
- Check if response body is matches the expected response body
Definition at line 927 of file LicenseControllerTest.php.
◆ testImportLicenseV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testImportLicenseV2 |
( |
| ) |
|
@runInSeparateProcess @preserveGlobalState disabled
- Test:
- Test for LicenseController::handleImportLicense() for version 2
- Check if response status is 200
- Check if response body is matches the expected response body
Definition at line 939 of file LicenseControllerTest.php.
◆ testMergeLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testMergeLicense |
( |
| ) |
|
- Test:
- Test LicenseController::mergeLicense()
- # Check if the status code is 200
- # Check if expected and actual object match
- Returns
- void
- Exceptions
-
Definition at line 2020 of file LicenseControllerTest.php.
◆ testMergeLicenseInternalServerError()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testMergeLicenseInternalServerError |
( |
| ) |
|
- Test:
- Test LicenseController::mergeLicense()
- # Check if HttpInternalServerErrorException is thrown for duplicate license name
- Returns
- void
- Exceptions
-
Definition at line 1983 of file LicenseControllerTest.php.
◆ testMergeLicenseNotAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testMergeLicenseNotAdmin |
( |
| ) |
|
- Test:
- Test LicenseController::mergeLicense()
- # Check if HttpForbiddenException is thrown for unauthorized users
- Returns
- void
- Exceptions
-
Definition at line 1862 of file LicenseControllerTest.php.
◆ testMergeLicenseWithBadRequest()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testMergeLicenseWithBadRequest |
( |
| ) |
|
- Test:
- Test LicenseController::mergeLicense()
- # Check if the HttpBadRequestException is thrown when shortName arg is empty
- Returns
- void
- Exceptions
-
Definition at line 1880 of file LicenseControllerTest.php.
◆ testMergeLicenseWithNoCandidateLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testMergeLicenseWithNoCandidateLicense |
( |
| ) |
|
- Test:
- Test LicenseController::mergeLicense()
- # Check if HttpNotFoundException is thrown for licenseCandidate that is not found.
- # Check is the response status s 404
- Returns
- void
- Exceptions
-
Definition at line 1953 of file LicenseControllerTest.php.
◆ testMergeLicenseWithSameName()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testMergeLicenseWithSameName |
( |
| ) |
|
- Test:
- Test LicenseController::mergeLicense()
- # Check if HttpBadRequestException is thrown for license whose name is the same as it parent.
- Returns
- void
- Exceptions
-
Definition at line 1902 of file LicenseControllerTest.php.
◆ testMergeNotFoundLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testMergeNotFoundLicense |
( |
| ) |
|
- Test:
- Test LicenseController::mergeLicense()
- # Check if HttpNotFoundException is thrown for notfound license.
- Returns
- void
- Exceptions
-
Definition at line 1924 of file LicenseControllerTest.php.
◆ testUpdateLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicense |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testUpdateLicenseNonAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseNonAdmin |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testUpdateLicenseNonAdminV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseNonAdminV1 |
( |
| ) |
|
◆ testUpdateLicenseNonAdminV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseNonAdminV2 |
( |
| ) |
|
◆ testUpdateLicenseNonAdvisor()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseNonAdvisor |
( |
|
$version = ApiVersion::V2 | ) |
|
|
private |
◆ testUpdateLicenseNonAdvisorV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseNonAdvisorV1 |
( |
| ) |
|
◆ testUpdateLicenseNonAdvisorV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseNonAdvisorV2 |
( |
| ) |
|
◆ testUpdateLicenseV1()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseV1 |
( |
| ) |
|
◆ testUpdateLicenseV2()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testUpdateLicenseV2 |
( |
| ) |
|
◆ testVerifyLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testVerifyLicense |
( |
| ) |
|
- Test:
- # Test LicenseController::verifyLicense()
- # Check if status codes match
- # Check of expected and actual response bodies match
- Returns
- void
- Exceptions
-
Definition at line 1797 of file LicenseControllerTest.php.
◆ testVerifyLicenseNotAdmin()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testVerifyLicenseNotAdmin |
( |
| ) |
|
- Test:
- # Test LicenseController::verifyLicense()
- # Check if HttpForbiddenException is thrown for unauthorized users
- Returns
- void
- Exceptions
-
Definition at line 1691 of file LicenseControllerTest.php.
◆ testVerifyLicenseWithBadRequest()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testVerifyLicenseWithBadRequest |
( |
| ) |
|
- Test:
- # Test LicenseController::verifyLicense()
- # Check if HttpBadRequestException is thrown for invalid body
- Returns
- void
- Exceptions
-
Definition at line 1709 of file LicenseControllerTest.php.
◆ testVerifyLicenseWithNonUniqueName()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testVerifyLicenseWithNonUniqueName |
( |
| ) |
|
- Test:
- # Test LicenseController::verifyLicense()
- # Check if status code is 400 for License whose shortName is not unique
- # Check if HttpBadRequestException is thrown
- Returns
- void
- Exceptions
-
Definition at line 1735 of file LicenseControllerTest.php.
◆ testVerifyNotFoundLicense()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::testVerifyNotFoundLicense |
( |
| ) |
|
- Test:
- # Test LicenseController::verifyLicense()
- # Check if status code is 404 for License which is not found
- # Check if HttpBadRequestException is thrown
- Returns
- void
- Exceptions
-
Definition at line 1767 of file LicenseControllerTest.php.
◆ translateLicenseToDb()
Fossology\UI\Api\Test\Controllers\LicenseControllerTest::translateLicenseToDb |
( |
|
$licenses | ) |
|
|
private |
◆ $adminLicenseAckDao
◆ $adminLicensePlugin
M MockInterface Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$adminLicensePlugin |
|
private |
◆ $assertCountBefore
integer Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$assertCountBefore |
|
private |
◆ $auth
Auth Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$auth |
|
private |
◆ $dbHelper
DbHelper Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$dbHelper |
|
private |
◆ $dbManager
DbManager Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$dbManager |
|
private |
◆ $groupId
integer Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$groupId |
|
private |
◆ $licenseCandidatePlugin
M MockInterface Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$licenseCandidatePlugin |
|
private |
◆ $licenseController
LicenseController Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$licenseController |
|
private |
◆ $licenseDao
LicenseDao Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$licenseDao |
|
private |
◆ $licenseStdCommentDao
◆ $restHelper
RestHelper Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$restHelper |
|
private |
◆ $streamFactory
StreamFactory Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$streamFactory |
|
private |
◆ $userDao
UserDao Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$userDao |
|
private |
◆ $userId
integer Fossology\UI\Api\Test\Controllers\LicenseControllerTest::$userId |
|
private |
The documentation for this class was generated from the following file: