FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Test\Controllers\AuthControllerTest Class Reference

Test for AuthController. More...

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

Public Member Functions

 testCreateNewJwtTokenV1 ()
 
 testCreateNewJwtTokenV2 ()
 
 testCreateNewJwtTokenExpiredToken ()
 
 testCreateNewJwtTokenInvalidPassword ()
 

Protected Member Functions

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

Private Member Functions

 testCreateNewJwtToken (int $version)
 

Private Attributes

 $dbHelper
 
 $restHelper
 
 $authController
 
 $assertCountBefore
 
 $streamFactory
 

Detailed Description

Test for AuthController.

Definition at line 39 of file AuthControllerTest.php.

Member Function Documentation

◆ setUp()

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

Setup test objects.

See also
PHPUnit_Framework_TestCase::setUp()

Definition at line 76 of file AuthControllerTest.php.

◆ tearDown()

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

Remove test objects.

See also
PHPUnit_Framework_TestCase::tearDown()

Definition at line 96 of file AuthControllerTest.php.

◆ testCreateNewJwtToken()

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

Definition at line 129 of file AuthControllerTest.php.

◆ testCreateNewJwtTokenExpiredToken()

Fossology\UI\Api\Test\Controllers\AuthControllerTest::testCreateNewJwtTokenExpiredToken ( )
Test:
  1. Mock the request to get a new token
  2. Mock a failed response of RestHelper::validateTokenRequest()
  3. Call AuthController::createNewJwtToken()
  4. Check if failed response is returned

Definition at line 193 of file AuthControllerTest.php.

◆ testCreateNewJwtTokenInvalidPassword()

Fossology\UI\Api\Test\Controllers\AuthControllerTest::testCreateNewJwtTokenInvalidPassword ( )
Test:
  1. Mock the request to get a new token
  2. Mock a failed response of AuthHelper::checkUsernameAndPassword()
  3. Call AuthController::createNewJwtToken()
  4. Check if failed response is returned

Definition at line 244 of file AuthControllerTest.php.

◆ testCreateNewJwtTokenV1()

Fossology\UI\Api\Test\Controllers\AuthControllerTest::testCreateNewJwtTokenV1 ( )
Test:
  1. Mock the request to get a new token with V1 parameters
  2. Call AuthController::createNewJwtToken()
  3. Check if response contains a new JWT token

Definition at line 109 of file AuthControllerTest.php.

◆ testCreateNewJwtTokenV2()

Fossology\UI\Api\Test\Controllers\AuthControllerTest::testCreateNewJwtTokenV2 ( )
Test:
  1. Mock the request to get a new token with V2 parameters
  2. Call AuthController::createNewJwtToken()
  3. Check if response contains a new JWT token

Definition at line 120 of file AuthControllerTest.php.

Member Data Documentation

◆ $assertCountBefore

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

Assertions before running tests

Definition at line 64 of file AuthControllerTest.php.

◆ $authController

AuthController Fossology\UI\Api\Test\Controllers\AuthControllerTest::$authController
private

Test object

Definition at line 58 of file AuthControllerTest.php.

◆ $dbHelper

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

DB Helper mock

Definition at line 46 of file AuthControllerTest.php.

◆ $restHelper

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

RestHelper mock

Definition at line 52 of file AuthControllerTest.php.

◆ $streamFactory

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

Stream factory to create body streams.

Definition at line 70 of file AuthControllerTest.php.


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