FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Test\Models\UserTest Class Reference

Tests for User model. More...

Inheritance diagram for Fossology\UI\Api\Test\Models\UserTest:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Test\Models\UserTest:
Collaboration graph

Public Member Functions

 testDataFormatV1 ()
 
 testDataFormatV2 ()
 

Protected Member Functions

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

Private Member Functions

 testDataFormat ($version)
 

Private Attributes

 $assertCountBefore
 
 $dbHelper
 
 $userDao
 
 $restHelper
 

Detailed Description

Tests for User model.

Definition at line 29 of file UserTest.php.

Member Function Documentation

◆ setUp()

Fossology\UI\Api\Test\Models\UserTest::setUp ( )
protected

Setup test objects.

See also
PHPUnit_Framework_TestCase::setUp()

Definition at line 56 of file UserTest.php.

◆ tearDown()

Fossology\UI\Api\Test\Models\UserTest::tearDown ( )
protected

Remove test objects.

See also
PHPUnit_Framework_TestCase::tearDown()

Definition at line 75 of file UserTest.php.

◆ testDataFormat()

Fossology\UI\Api\Test\Models\UserTest::testDataFormat (   $version)
private
Parameters
$versionversion to test
Returns
void
  1. Test the data format returned by User::getArray($version) model

Definition at line 117 of file UserTest.php.

◆ testDataFormatV1()

Fossology\UI\Api\Test\Models\UserTest::testDataFormatV1 ( )

Helper function to get JSON array from response

Parameters
Response$response
Returns
array Decoded response
Test:
  1. Test the data format returned by User::getArray($version) model when $version is V1
  2. Create expected array
  3. Create test object and set the values
  4. Get the array from object and match with expected array

Definition at line 95 of file UserTest.php.

◆ testDataFormatV2()

Fossology\UI\Api\Test\Models\UserTest::testDataFormatV2 ( )
Test:
  1. Test the data format returned by User::getArray($version) model when $version is V2
  2. Create expected array
  3. Create test object and set the values
  4. Get the array from object and match with expected array

Definition at line 107 of file UserTest.php.

Member Data Documentation

◆ $assertCountBefore

integer Fossology\UI\Api\Test\Models\UserTest::$assertCountBefore
private

Assertions before running tests

Definition at line 35 of file UserTest.php.

◆ $dbHelper

DbHelper Fossology\UI\Api\Test\Models\UserTest::$dbHelper
private

DbHelper mock

Definition at line 40 of file UserTest.php.

◆ $restHelper

RestHelper Fossology\UI\Api\Test\Models\UserTest::$restHelper
private

RestHelper mock

Definition at line 51 of file UserTest.php.

◆ $userDao

UserDao Fossology\UI\Api\Test\Models\UserTest::$userDao
private

UserDao mock

Definition at line 45 of file UserTest.php.


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