FOSSology  4.7.1
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Test\Controllers\CopyrightControllerTest Class Reference
Inheritance diagram for Fossology\UI\Api\Test\Controllers\CopyrightControllerTest:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Test\Controllers\CopyrightControllerTest:
Collaboration graph

Public Member Functions

 setUp ()
 Setup test objects. More...
 
 testGetTotalFileCopyrightsUploadNotFound ()
 
 testGetTotalFileCopyrightsItemNotFound ()
 
 testGetTotalFileCopyrightsWithBadRequest ()
 
 testGetTotalFileCopyrightsWithInvalidQueryParams ()
 
 testGetFileCopyrightsWithInvalidLimit ()
 
 testGetFileCopyrights ()
 
 testGetFileCopyrightsWithInvalidPage ()
 
 getDummyData ()
 
 testGetFileEmail ()
 
 testGetFileUrl ()
 
 testGetFileAuthor ()
 
 testGetFileEcc ()
 
 testGetFileKeyword ()
 
 testGetFileIpra ()
 
 testDeleteFileCopyright ()
 
 testDeleteFileEmail ()
 
 testDeleteFileUrl ()
 
 testDeleteFileAuthor ()
 
 testDeleteFileEcc ()
 
 testDeleteFileKeyword ()
 
 testDeleteFileIpra ()
 
 testDeleteFileCopyrightForbiddenWithReadOnlyPermission ()
 
 testRestoreFileCopyrightForbiddenWithReadOnlyPermission ()
 
 testUpdateFileCopyrightForbiddenWithReadOnlyPermission ()
 

Public Attributes

 $auth
 
 $userDao
 

Private Member Functions

 getResponseJson ($response)
 

Private Attributes

 $dbHelper
 
 $restHelper
 
 $copyrightDao
 
 $uploadDao
 
 $copyrightController
 
 $copyrightHist
 
 $streamFactory
 

Detailed Description

Definition at line 38 of file CopyrightControllerTest.php.

Member Function Documentation

◆ getResponseJson()

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

Helper function to get JSON array from response

Parameters
Response$response
Returns
array Decoded response

Definition at line 120 of file CopyrightControllerTest.php.

◆ setUp()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::setUp ( )

Setup test objects.

See also
PHPUnit_Framework_TestCase::setUp()

Definition at line 88 of file CopyrightControllerTest.php.

◆ testDeleteFileAuthor()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileAuthor ( )
Test:
  1. Test CopyrightController::deleteFileAuthor() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 835 of file CopyrightControllerTest.php.

◆ testDeleteFileCopyright()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileCopyright ( )
Test:
  1. Test CopyrightController::deleteFileCopyright() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 669 of file CopyrightControllerTest.php.

◆ testDeleteFileCopyrightForbiddenWithReadOnlyPermission()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileCopyrightForbiddenWithReadOnlyPermission ( )
Test:
  1. Test CopyrightController::deleteFileCopyright() with a group that only has read-only permission (isEditable returns false).
  2. Check if response is 403 with HttpForbiddenException.

Definition at line 1054 of file CopyrightControllerTest.php.

◆ testDeleteFileEcc()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileEcc ( )
Test:
  1. Test CopyrightController::deleteFileEcc() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 889 of file CopyrightControllerTest.php.

◆ testDeleteFileEmail()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileEmail ( )
Test:
  1. Test CopyrightController::deleteFileEmail() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 724 of file CopyrightControllerTest.php.

◆ testDeleteFileIpra()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileIpra ( )
Test:
  1. Test CopyrightController::deleteFileIpra() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 1000 of file CopyrightControllerTest.php.

◆ testDeleteFileKeyword()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileKeyword ( )
Test:
  1. Test CopyrightController::deleteFileKeyword() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 944 of file CopyrightControllerTest.php.

◆ testDeleteFileUrl()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testDeleteFileUrl ( )
Test:
  1. Test CopyrightController::deleteFileEmail() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 778 of file CopyrightControllerTest.php.

◆ testGetFileAuthor()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileAuthor ( )
Test:
  1. Test CopyrightController::getFileAuthor() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 485 of file CopyrightControllerTest.php.

◆ testGetFileCopyrights()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileCopyrights ( )
Test:
  1. Test CopyrightController::getFileCopyrights() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 284 of file CopyrightControllerTest.php.

◆ testGetFileCopyrightsWithInvalidLimit()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileCopyrightsWithInvalidLimit ( )
Test:
  1. Test CopyrightController::getFileCopyrights() with invalid limit.
  2. Check if the status code is 400 with HttpBadRequestException

Definition at line 260 of file CopyrightControllerTest.php.

◆ testGetFileCopyrightsWithInvalidPage()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileCopyrightsWithInvalidPage ( )
Test:
  1. Test CopyrightController::getFileCopyrights() with Invalid page.
  2. Check if the status code is 400 with HttpBadRequestException .

Definition at line 329 of file CopyrightControllerTest.php.

◆ testGetFileEcc()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileEcc ( )
Test:
  1. Test CopyrightController::getFileEcc() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 531 of file CopyrightControllerTest.php.

◆ testGetFileEmail()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileEmail ( )
Test:
  1. Test CopyrightController::getFileEmail() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 390 of file CopyrightControllerTest.php.

◆ testGetFileIpra()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileIpra ( )
Test:
  1. Test CopyrightController::getFileIpra() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 624 of file CopyrightControllerTest.php.

◆ testGetFileKeyword()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileKeyword ( )
Test:
  1. Test CopyrightController::getFileKeyword() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 578 of file CopyrightControllerTest.php.

◆ testGetFileUrl()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetFileUrl ( )
Test:
  1. Test CopyrightController::getFileUrl() with success.
  2. Check if the actual and expected responses are same.
  3. Check if the status code is 200

Definition at line 437 of file CopyrightControllerTest.php.

◆ testGetTotalFileCopyrightsItemNotFound()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetTotalFileCopyrightsItemNotFound ( )
Test:
  1. Test CopyrightController::getTotalFileCopyrights() with item that is not found
  2. Check if response is 404 with HttpNotFoundException.

Definition at line 152 of file CopyrightControllerTest.php.

◆ testGetTotalFileCopyrightsUploadNotFound()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetTotalFileCopyrightsUploadNotFound ( )
Test:
  1. Test CopyrightController::getTotalFileCopyrights() with upload that is not accessible
  2. Check if response is 404 with HttpNotFoundException.

Definition at line 130 of file CopyrightControllerTest.php.

◆ testGetTotalFileCopyrightsWithBadRequest()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetTotalFileCopyrightsWithBadRequest ( )
Test:
  1. Test CopyrightController::getTotalFileCopyrights() with bad request, no query parameters provided
  2. Check if response is 400 with HttpBadRequestException.

Definition at line 185 of file CopyrightControllerTest.php.

◆ testGetTotalFileCopyrightsWithInvalidQueryParams()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testGetTotalFileCopyrightsWithInvalidQueryParams ( )
Test:
  1. Test CopyrightController::getTotalFileCopyrights()
  2. Check if both expected and actual object match.
  3. Check if the response status code is 200

Definition at line 219 of file CopyrightControllerTest.php.

◆ testRestoreFileCopyrightForbiddenWithReadOnlyPermission()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testRestoreFileCopyrightForbiddenWithReadOnlyPermission ( )
Test:
  1. Test CopyrightController::restoreFileCopyright() with a group that only has read-only permission (isEditable returns false).
  2. Check if response is 403 with HttpForbiddenException.

Definition at line 1090 of file CopyrightControllerTest.php.

◆ testUpdateFileCopyrightForbiddenWithReadOnlyPermission()

Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::testUpdateFileCopyrightForbiddenWithReadOnlyPermission ( )
Test:
  1. Test CopyrightController::updateFileCopyright() with a group that only has read-only permission (isEditable returns false).
  2. Check if response is 403 with HttpForbiddenException.

Definition at line 1126 of file CopyrightControllerTest.php.

Member Data Documentation

◆ $copyrightController

CopyrightController Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::$copyrightController
private

copyrightController object to test

Definition at line 71 of file CopyrightControllerTest.php.

◆ $copyrightDao

CopyrightDao Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::$copyrightDao
private

CopyrightDao mock

Definition at line 59 of file CopyrightControllerTest.php.

◆ $copyrightHist

M MockInterface Fossology\UI\Api\Test\Controllers\CopyrightControllerTest::$copyrightHist
private

ajaxCopyrightPlugin mock

Definition at line 77 of file CopyrightControllerTest.php.

◆ $dbHelper

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

DbHelper mock

Definition at line 47 of file CopyrightControllerTest.php.

◆ $restHelper

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

RestHelper mock

Definition at line 53 of file CopyrightControllerTest.php.

◆ $streamFactory

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

Stream factory to create body streams.

Definition at line 82 of file CopyrightControllerTest.php.

◆ $uploadDao

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

UploadDao mock

Definition at line 64 of file CopyrightControllerTest.php.


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