FOSSology  4.7.1
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Test\Controllers\UploadControllerTest Class Reference

Unit tests for UploadController. More...

Inheritance diagram for Fossology\UI\Api\Test\Controllers\UploadControllerTest:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Test\Controllers\UploadControllerTest:
Collaboration graph

Public Member Functions

 testGetSingleUploadV1 ()
 
 testGetSingleUploadV2 ()
 
 testGetSingleUploadInAccessible ()
 
 testGetUploadWithFiltersV1 ()
 
 testGetUploadWithFiltersV2 ()
 
 testGetUploadsV1 ()
 
 testGetUploadsV2 ()
 
 testGetSingleUploadNotUnpacked ()
 
 testCopyUploadV1 ()
 
 testCopyUploadV2 ()
 
 testMoveUploadInvalidFolderV1 ()
 
 testMoveUploadInvalidFolderV2 ()
 
 testPostUploadV1 ()
 
 testPostUploadV2 ()
 
 testPostUploadNegativeFolderIdV2 ()
 
 testPostUploadFolderNotAccessibleV1 ()
 
 testPostUploadFolderNotAccessibleV2 ()
 
 testPostUploadFolderNotFoundV1 ()
 
 testPostUploadFolderNotFoundV2 ()
 
 testPostUploadInternalErrorV1 ()
 
 testPostUploadInternalErrorV2 ()
 
 testGetUploadLicensesV1 ()
 
 testGetUploadLicensesV2 ()
 
 testGetUploadLicensesPendingScanV1 ()
 
 testGetUploadLicensesPendingScanV2 ()
 
 testUpdateUpload ()
 
 testUpdateUploadNoPerm ()
 
 testGetMainLicenses ()
 
 testSetMainLicense ()
 
 testSetMainLicense_exists ()
 
 testSetMainLicense_forbiddenForReadOnlyUser ()
 
 testRemoveMainLicense ()
 
 testRemoveMainLicense_forbiddenForReadOnlyUser ()
 
 testGetClearingProgressInfo ()
 
 testGetReuseReportSummary ()
 
 testSetGroupsWithPermissions ()
 
 testSetGroupsWithPermissionsNotFound ()
 
 testSetGroupsWithPermissionsUploadNotAccessible ()
 
 testGetAllAgents ()
 
 testGetAllAgentsUploadNotFound ()
 
 testGetAllAgentsUploadNotAccessible ()
 
 testGetEditedLicenses ()
 
 testGetEditedLicensesNotFound ()
 
 testGetEditedLicensesForbidden ()
 
 testGetScannedLicenses ()
 
 testGetScannedLicensesWithNoLicenseFound ()
 
 testGetScannedLicensesNotFound ()
 
 testAgentsRevision ()
 
 testAgentsRevisionNotFound ()
 
 testAgentsRevisionForbidden ()
 
 testGetTopItem ()
 
 testGetTopItemUploadNotFound ()
 
 testGetTopItemInternalServerError ()
 
 testUploadDownloadNotUnpacked ()
 
 testUploadDownloadFileNotFound ()
 

Public Attributes

 $userDao
 

Static Public Attributes

static $functions
 

Protected Member Functions

 setUp ()
 Setup test objects. More...
 
 tearDown ()
 Remove test objects. More...
 

Private Member Functions

 getResponseJson ($response)
 
 getUploadBounds ($id)
 
 getUpload ($id)
 
 testGetSingleUpload ($version)
 
 testGetUploadWithFilters ($version)
 
 testGetUploads ($version)
 
 testCopyUpload ($version)
 
 testMoveUploadInvalidFolder ($version=ApiVersion::V2)
 
 testPostUpload (int $version)
 
 testPostUploadFolderNotAccessible (int $version)
 
 testPostUploadFolderNotFound (int $version)
 
 testPostUploadInternalError (int $version)
 
 testGetUploadLicenses ($version)
 
 testGetUploadLicensesPendingScan ($version=ApiVersion::V2)
 

Private Attributes

 $assertCountBefore
 
 $userId
 
 $groupId
 
 $dbHelper
 
 $dbManager
 
 $restHelper
 
 $uploadController
 
 $uploadDao
 
 $uploadPermissionDao
 
 $folderDao
 
 $agentDao
 
 $clearingDao
 
 $licenseDao
 
 $reuseReportProcess
 
 $streamFactory
 
 $copyrightPlugin
 
 $downloadPlugin
 

Detailed Description

Unit tests for UploadController.

Definition at line 63 of file UploadControllerTest.php.

Member Function Documentation

◆ getResponseJson()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::getResponseJson (   $response)
private

Helper function to get JSON array from response

Parameters
Response$response
Returns
array Decoded response

Definition at line 249 of file UploadControllerTest.php.

◆ getUpload()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::getUpload (   $id)
private

Helper function to generate uploads

Parameters
integer$idUpload id (if > 4, return NULL)
Returns
NULL|Upload

Definition at line 276 of file UploadControllerTest.php.

◆ getUploadBounds()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::getUploadBounds (   $id)
private

Helper function to generate uploads bounds

Parameters
integer$idUpload id (if > 4, return false)
Returns
false|ItemTreeBounds

Definition at line 260 of file UploadControllerTest.php.

◆ setUp()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::setUp ( )
protected

Setup test objects.

See also
PHPUnit_Framework_TestCase::setUp()

Definition at line 177 of file UploadControllerTest.php.

◆ tearDown()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::tearDown ( )
protected

Remove test objects.

See also
PHPUnit_Framework_TestCase::tearDown()

Definition at line 236 of file UploadControllerTest.php.

◆ testAgentsRevision()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testAgentsRevision ( )
Test:
  1. Test UploadController::agentsRevision()
  2. Check if is the statusCode is 200. @runInSeparateProcess @preserveGlobalState disabled

Definition at line 1956 of file UploadControllerTest.php.

◆ testAgentsRevisionForbidden()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testAgentsRevisionForbidden ( )
Test:
  1. Test UploadController::agentsRevision()
  2. Check if HttpForbiddenException is thrown. /

Definition at line 2006 of file UploadControllerTest.php.

◆ testAgentsRevisionNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testAgentsRevisionNotFound ( )
Test:
  1. Test UploadController::agentsRevision()
  2. Check if HttpNotFoundException is thrown. /

Definition at line 1989 of file UploadControllerTest.php.

◆ testCopyUpload()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testCopyUpload (   $version)
private
Parameters
$versionversion to test
Returns
void
  1. Test the data format returned by Upload::getArray($version) model

Definition at line 638 of file UploadControllerTest.php.

◆ testCopyUploadV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testCopyUploadV1 ( )
Test:
  1. Test for UploadController::moveUpload() for a copy action when version is V1
  2. Check if response status is 202

Definition at line 620 of file UploadControllerTest.php.

◆ testCopyUploadV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testCopyUploadV2 ( )
Test:
  1. Test for UploadController::moveUpload() for a copy action when version is V2
  2. Check if response status is 202

Definition at line 629 of file UploadControllerTest.php.

◆ testGetAllAgents()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetAllAgents ( )

@runInSeparateProcess @preserveGlobalState disabled

Definition at line 1682 of file UploadControllerTest.php.

◆ testGetAllAgentsUploadNotAccessible()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetAllAgentsUploadNotAccessible ( )
Test:
  1. Test UploadController::getAllAgentsUpload()
  2. Check if the HttpForbiddenException is thrown /

Definition at line 1736 of file UploadControllerTest.php.

◆ testGetAllAgentsUploadNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetAllAgentsUploadNotFound ( )
Test:
  1. Test UploadController::getAllAgentsUpload()
  2. Check if the HttpNotFoundException is thrown /

Definition at line 1719 of file UploadControllerTest.php.

◆ testGetClearingProgressInfo()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetClearingProgressInfo ( )
Test:
  1. Test for UploadController::getClearingProgressInfo()
  2. Check if response status is 200 and the body matches

Definition at line 1533 of file UploadControllerTest.php.

◆ testGetEditedLicenses()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetEditedLicenses ( )
Test:
  1. Test UploadController::getEditedLicense()
  2. Check if the statusCode is 200. /

Definition at line 1756 of file UploadControllerTest.php.

◆ testGetEditedLicensesForbidden()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetEditedLicensesForbidden ( )
Test:
  1. Test UploadController::getEditedLicense()
  2. Check if HttpForbiddenException is thrown. /

Definition at line 1798 of file UploadControllerTest.php.

◆ testGetEditedLicensesNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetEditedLicensesNotFound ( )
Test:
  1. Test UploadController::getEditedLicense()
  2. Check if HttpNotFoundException is thrown. /

Definition at line 1779 of file UploadControllerTest.php.

◆ testGetMainLicenses()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetMainLicenses ( )
Test:
  1. Test for UploadController::getMainLicenses()
  2. Check if response status is 200 and RES body matches

Definition at line 1323 of file UploadControllerTest.php.

◆ testGetReuseReportSummary()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetReuseReportSummary ( )
Test:
  1. Test for UploadController::getReuseReportSummary()
  2. Check if response status is 200 & Response body is correct

Definition at line 1572 of file UploadControllerTest.php.

◆ testGetScannedLicenses()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetScannedLicenses ( )
Test:
  1. Test UploadController::getScannedLicenses()
  2. Check if status code is 200 and response contains correct license data. @runInSeparateProcess @preserveGlobalState disabled

Definition at line 1818 of file UploadControllerTest.php.

◆ testGetScannedLicensesNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetScannedLicensesNotFound ( )
Test:
  1. Test UploadController::getScannedLicense()
  2. Check if HttpNotFoundException is thrown. /

Definition at line 1932 of file UploadControllerTest.php.

◆ testGetScannedLicensesWithNoLicenseFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetScannedLicensesWithNoLicenseFound ( )
Test:
  1. Test UploadController::getScannedLicenses()
  2. Verify that uploads with files having no detected license (No_license_found) return 200 without crashing. @runInSeparateProcess @preserveGlobalState disabled

Definition at line 1872 of file UploadControllerTest.php.

◆ testGetSingleUpload()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetSingleUpload (   $version)
private
Parameters
$version
Returns
void
Exceptions

Definition at line 332 of file UploadControllerTest.php.

◆ testGetSingleUploadInAccessible()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetSingleUploadInAccessible ( )
Test:
  1. Test for UploadController::getUploads() for inaccessible upload
  2. Check if response status is 403

Definition at line 374 of file UploadControllerTest.php.

◆ testGetSingleUploadNotUnpacked()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetSingleUploadNotUnpacked ( )
Test:
  1. Test for UploadController::getUploads() where ununpack not finished
  2. Check if the response status is 503
  3. Check if the response has headers Retry-After and Look-at set

Definition at line 596 of file UploadControllerTest.php.

◆ testGetSingleUploadV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetSingleUploadV1 ( )
Test:
  1. Test for UploadController::getUploads() to fetch single upload when version is V1
  2. Check if response is 200

Definition at line 313 of file UploadControllerTest.php.

◆ testGetSingleUploadV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetSingleUploadV2 ( )
Test:
  1. Test for UploadController::getUploads() to fetch single upload when version is V2
  2. Check if response is 200

Definition at line 322 of file UploadControllerTest.php.

◆ testGetTopItem()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetTopItem ( )
Test:
  1. Test UploadController::getTopItem()
  2. Check if response status is 404 /

Definition at line 2025 of file UploadControllerTest.php.

◆ testGetTopItemInternalServerError()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetTopItemInternalServerError ( )
Test:
  1. Test UploadController::getTopItem()
  2. Check if response status is 500 /

Definition at line 2072 of file UploadControllerTest.php.

◆ testGetTopItemUploadNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetTopItemUploadNotFound ( )
Test:
  1. Test UploadController::getTopItem()
  2. Check if response status is 404 /

Definition at line 2050 of file UploadControllerTest.php.

◆ testGetUploadLicensesPendingScan()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadLicensesPendingScan (   $version = ApiVersion::V2)
private
Parameters
$versionto test
Returns
void

Definition at line 1200 of file UploadControllerTest.php.

◆ testGetUploadLicensesPendingScanV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadLicensesPendingScanV1 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::getUploadLicenses() when agents pending with version 1 params
  2. Check if response status is 503
  3. Check if response headers Retry-After and Look-at set

Definition at line 1180 of file UploadControllerTest.php.

◆ testGetUploadLicensesPendingScanV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadLicensesPendingScanV2 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::getUploadLicenses() when agents pending with version 2 params
  2. Check if response status is 503
  3. Check if response headers Retry-After and Look-at set

Definition at line 1192 of file UploadControllerTest.php.

◆ testGetUploadLicensesV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadLicensesV1 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::getUploadLicenses() when version is V1
  2. Check if the response status is 200 with correct information

Definition at line 1103 of file UploadControllerTest.php.

◆ testGetUploadLicensesV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadLicensesV2 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::getUploadLicenses() when version is V2
  2. Check if the response status is 200 with correct information

Definition at line 1114 of file UploadControllerTest.php.

◆ testGetUploadsV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadsV1 ( )
Test:
  1. Test UploadController::getUploads() for all uploads when version is V1
  2. Check if the response is array with status 200

Definition at line 545 of file UploadControllerTest.php.

◆ testGetUploadsV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadsV2 ( )
Test:
  1. Test UploadController::getUploads() for all uploads when version is V2
  2. Check if the response is array with status 200

Definition at line 553 of file UploadControllerTest.php.

◆ testGetUploadWithFiltersV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadWithFiltersV1 ( )
Test:
  1. Test for UploadController::getUploads() with filters when version is V1
  2. Setup various options according to query parameter which will be passed to DbHelper::getUploads()
  3. Make sure all mocks are having once() set to force mockery

Definition at line 398 of file UploadControllerTest.php.

◆ testGetUploadWithFiltersV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testGetUploadWithFiltersV2 ( )
Test:
  1. Test for UploadController::getUploads() with filters when version is V2
  2. Setup various options according to query parameter which will be passed to DbHelper::getUploads()
  3. Make sure all mocks are having once() set to force mockery

Definition at line 409 of file UploadControllerTest.php.

◆ testMoveUploadInvalidFolder()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testMoveUploadInvalidFolder (   $version = ApiVersion::V2)
private
Parameters
$version
Returns
void

Definition at line 702 of file UploadControllerTest.php.

◆ testMoveUploadInvalidFolderV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testMoveUploadInvalidFolderV1 ( )

getUploadSummary, getLicensesHistogram, setUploadPermissions, getUploadCopyrights,deleteUpload

Test:
  1. Test for UploadController::moveUpload() with invalid folder id with version 1
  2. Check if response status is 400

Definition at line 685 of file UploadControllerTest.php.

◆ testMoveUploadInvalidFolderV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testMoveUploadInvalidFolderV2 ( )
Test:
  1. Test for UploadController::moveUpload() with invalid folder id with version 2
  2. Check if response status is 400

Definition at line 694 of file UploadControllerTest.php.

◆ testPostUpload()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUpload ( int  $version)
private
Parameters
int$versionVersion to test
Returns
void

Definition at line 753 of file UploadControllerTest.php.

◆ testPostUploadFolderNotAccessible()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadFolderNotAccessible ( int  $version)
private
Parameters
int$versionVersion to test
Returns
void

Definition at line 893 of file UploadControllerTest.php.

◆ testPostUploadFolderNotAccessibleV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadFolderNotAccessibleV1 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with inaccessible folder with V1 parameters
  2. Check if response status is 403

Definition at line 872 of file UploadControllerTest.php.

◆ testPostUploadFolderNotAccessibleV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadFolderNotAccessibleV2 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with inaccessible folder with V2 parameters
  2. Check if response status is 403

Definition at line 884 of file UploadControllerTest.php.

◆ testPostUploadFolderNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadFolderNotFound ( int  $version)
private
Parameters
int$versionVersion to test
Returns
void

Definition at line 966 of file UploadControllerTest.php.

◆ testPostUploadFolderNotFoundV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadFolderNotFoundV1 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with invalid folder id with V1 parameters
  2. Check if response status is 404

Definition at line 945 of file UploadControllerTest.php.

◆ testPostUploadFolderNotFoundV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadFolderNotFoundV2 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with invalid folder id with V2 parameters
  2. Check if response status is 404

Definition at line 957 of file UploadControllerTest.php.

◆ testPostUploadInternalError()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadInternalError ( int  $version)
private
Parameters
int$versionVersion to test
Returns
void

Definition at line 1037 of file UploadControllerTest.php.

◆ testPostUploadInternalErrorV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadInternalErrorV1 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with internal error with V1 parameters
  2. Check if response status is 500 with error messages set

Definition at line 1016 of file UploadControllerTest.php.

◆ testPostUploadInternalErrorV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadInternalErrorV2 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with internal error with V2 parameters
  2. Check if response status is 500 with error messages set

Definition at line 1028 of file UploadControllerTest.php.

◆ testPostUploadNegativeFolderIdV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadNegativeFolderIdV2 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with negative folderId (V2)
  2. Negative folderId is invalid input and should return 400

Definition at line 830 of file UploadControllerTest.php.

◆ testPostUploadV1()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadV1 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with V1 parameters
  2. Check if response status is 201 with upload id

Definition at line 732 of file UploadControllerTest.php.

◆ testPostUploadV2()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testPostUploadV2 ( )

@runInSeparateProcess @preserveGlobalState disabled

Test:
  1. Test for UploadController::postUpload() with V2 parameters
  2. Check if response status is 201 with upload id

Definition at line 744 of file UploadControllerTest.php.

◆ testRemoveMainLicense()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testRemoveMainLicense ( )
Test:
  1. Test for UploadController::removeMainLicense()
  2. Check if response status is 200 and the body matches

Definition at line 1471 of file UploadControllerTest.php.

◆ testRemoveMainLicense_forbiddenForReadOnlyUser()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testRemoveMainLicense_forbiddenForReadOnlyUser ( )
Test:
  1. Test for UploadController::removeMainLicense()
  2. Check if HttpForbiddenException is thrown when user lacks write permission

Definition at line 1510 of file UploadControllerTest.php.

◆ testSetGroupsWithPermissions()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testSetGroupsWithPermissions ( )
Test:
  1. Test UploadController::setGroupsWithPermissions()
  2. Check if the statusCode is 200 /

Definition at line 1607 of file UploadControllerTest.php.

◆ testSetGroupsWithPermissionsNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testSetGroupsWithPermissionsNotFound ( )
Test:
  1. Test UploadController::setGroupsWithPermissions()
  2. Check if the HttpNotFoundException is thrown /

Definition at line 1640 of file UploadControllerTest.php.

◆ testSetGroupsWithPermissionsUploadNotAccessible()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testSetGroupsWithPermissionsUploadNotAccessible ( )
Test:
  1. Test UploadController::setGroupsWithPermissions()
  2. Check if the HttpForbiddenException is thrown /

Definition at line 1663 of file UploadControllerTest.php.

◆ testSetMainLicense()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testSetMainLicense ( )
Test:
  1. Test for UploadController::setMainLicense()
  2. Check if response status is 200 and Res body matches

Definition at line 1354 of file UploadControllerTest.php.

◆ testSetMainLicense_exists()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testSetMainLicense_exists ( )
Test:
  1. Test for UploadController::setMainLicense()
  2. Check if response status is 400, when the license already Exists and Res body matches

Definition at line 1401 of file UploadControllerTest.php.

◆ testSetMainLicense_forbiddenForReadOnlyUser()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testSetMainLicense_forbiddenForReadOnlyUser ( )
Test:
  1. Test for UploadController::setMainLicense()
  2. Check if HttpForbiddenException is thrown when user lacks write permission

Definition at line 1441 of file UploadControllerTest.php.

◆ testUpdateUpload()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testUpdateUpload ( )
Test:
  1. Test for UploadController::updateUpload()
  2. Check if response status is 202

Definition at line 1249 of file UploadControllerTest.php.

◆ testUpdateUploadNoPerm()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testUpdateUploadNoPerm ( )
Test:
  1. Test for UploadController::updateUpload() without permission
  2. Check if response status is 403

Definition at line 1295 of file UploadControllerTest.php.

◆ testUploadDownloadFileNotFound()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testUploadDownloadFileNotFound ( )
Test:
  1. Test for UploadController::uploadDownload() where upload root file is missing
  2. Check if the dynamic uploadtree table is queried
  3. Check if HttpNotFoundException is thrown

Definition at line 2116 of file UploadControllerTest.php.

◆ testUploadDownloadNotUnpacked()

Fossology\UI\Api\Test\Controllers\UploadControllerTest::testUploadDownloadNotUnpacked ( )
Test:
  1. Test for UploadController::uploadDownload() where ununpack not finished
  2. Check if HttpServiceUnavailableException is thrown

Definition at line 2094 of file UploadControllerTest.php.

Member Data Documentation

◆ $agentDao

AgentDao Fossology\UI\Api\Test\Controllers\UploadControllerTest::$agentDao
private

AgentDao mock

Definition at line 137 of file UploadControllerTest.php.

◆ $assertCountBefore

integer Fossology\UI\Api\Test\Controllers\UploadControllerTest::$assertCountBefore
private

Assertions before running tests

Definition at line 77 of file UploadControllerTest.php.

◆ $clearingDao

ClearingDao Fossology\UI\Api\Test\Controllers\UploadControllerTest::$clearingDao
private

ClearingDao mock

Definition at line 143 of file UploadControllerTest.php.

◆ $dbHelper

DbHelper Fossology\UI\Api\Test\Controllers\UploadControllerTest::$dbHelper
private

DbHelper mock

Definition at line 95 of file UploadControllerTest.php.

◆ $dbManager

DbManager Fossology\UI\Api\Test\Controllers\UploadControllerTest::$dbManager
private

Dbmanager mock

Definition at line 101 of file UploadControllerTest.php.

◆ $folderDao

FolderDao Fossology\UI\Api\Test\Controllers\UploadControllerTest::$folderDao
private

FolderDao mock

Definition at line 131 of file UploadControllerTest.php.

◆ $functions

Mockery MockInterface Fossology\UI\Api\Test\Controllers\UploadControllerTest::$functions
static

Public function mock

Definition at line 71 of file UploadControllerTest.php.

◆ $groupId

integer Fossology\UI\Api\Test\Controllers\UploadControllerTest::$groupId
private

Group ID to mock

Definition at line 89 of file UploadControllerTest.php.

◆ $licenseDao

LicenseDao Fossology\UI\Api\Test\Controllers\UploadControllerTest::$licenseDao
private

LicenseDao mock

Definition at line 149 of file UploadControllerTest.php.

◆ $restHelper

RestHelper Fossology\UI\Api\Test\Controllers\UploadControllerTest::$restHelper
private

RestHelper mock

Definition at line 107 of file UploadControllerTest.php.

◆ $reuseReportProcess

ReuseReportProcessor Fossology\UI\Api\Test\Controllers\UploadControllerTest::$reuseReportProcess
private

ReuseReportProcessor mock

Definition at line 155 of file UploadControllerTest.php.

◆ $streamFactory

StreamFactory Fossology\UI\Api\Test\Controllers\UploadControllerTest::$streamFactory
private

Stream factory to create body streams.

Definition at line 161 of file UploadControllerTest.php.

◆ $uploadController

UploadController Fossology\UI\Api\Test\Controllers\UploadControllerTest::$uploadController
private

UploadController mock

Definition at line 113 of file UploadControllerTest.php.

◆ $uploadDao

UploadDao Fossology\UI\Api\Test\Controllers\UploadControllerTest::$uploadDao
private

UploadDao mock

Definition at line 119 of file UploadControllerTest.php.

◆ $uploadPermissionDao

UploadPermissionDao Fossology\UI\Api\Test\Controllers\UploadControllerTest::$uploadPermissionDao
private

UploadPermissionDao mock

Definition at line 125 of file UploadControllerTest.php.

◆ $userId

integer Fossology\UI\Api\Test\Controllers\UploadControllerTest::$userId
private

User ID to mock

Definition at line 83 of file UploadControllerTest.php.


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