FOSSology  4.4.0
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 ()
 

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 117 of file CopyrightControllerTest.php.

◆ setUp()

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

Setup test objects.

See also
PHPUnit_Framework_TestCase::setUp()

Definition at line 85 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 815 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 655 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 867 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 708 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 974 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 920 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 760 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 475 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 278 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 254 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 322 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 520 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 382 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 611 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 566 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 428 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 149 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 127 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 181 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 214 of file CopyrightControllerTest.php.

Member Data Documentation

◆ $copyrightController

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

copyrightController object to test

Definition at line 68 of file CopyrightControllerTest.php.

◆ $copyrightDao

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

CopyrightDao mock

Definition at line 56 of file CopyrightControllerTest.php.

◆ $copyrightHist

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

ajaxCopyrightPlugin mock

Definition at line 74 of file CopyrightControllerTest.php.

◆ $dbHelper

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

DbHelper mock

Definition at line 44 of file CopyrightControllerTest.php.

◆ $restHelper

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

RestHelper mock

Definition at line 50 of file CopyrightControllerTest.php.

◆ $streamFactory

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

Stream factory to create body streams.

Definition at line 79 of file CopyrightControllerTest.php.

◆ $uploadDao

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

UploadDao mock

Definition at line 61 of file CopyrightControllerTest.php.


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