FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
CopyrightScheduledTest Class Reference

Unit test cases for copyright agent using scheduler. More...

Inheritance diagram for CopyrightScheduledTest:
Inheritance graph
Collaboration diagram for CopyrightScheduledTest:
Collaboration graph

Public Member Functions

 testRun ()
 Run the test. More...
 

Protected Member Functions

 setUp ()
 Setup the test cases and initialize the objects. More...
 
 tearDown ()
 Destruct the objects initialized during setUp() More...
 

Private Member Functions

 runCopyright ($uploadId)
 Run copyright on a given upload id. More...
 
 setUpRepo ()
 Setup test repo mimicking install.
 
 rmRepo ()
 Remove the test repo.
 
 setUpTables ()
 Setup tables required by copyright agent.
 

Private Attributes

 $testDb
 
 $dbManager
 
 $licenseDao
 
 $uploadDao
 
 $uploadPermDao
 
 $copyrightDao
 

Detailed Description

Unit test cases for copyright agent using scheduler.

Definition at line 43 of file schedulerTest.php.

Member Function Documentation

CopyrightScheduledTest::runCopyright (   $uploadId)
private

Run copyright on a given upload id.

Setup copyright agent and test environment then run copyright agent and pass the given upload id to scan.

Reports error if agent return code is not 0.

Parameters
int$uploadIdUpload id to be scanned
Returns
string Copyright findings returned by the agent

Definition at line 109 of file schedulerTest.php.

CopyrightScheduledTest::setUp ( )
protected

Setup the test cases and initialize the objects.

See also
PHPUnit_Framework_TestCase::setUp()

Definition at line 74 of file schedulerTest.php.

CopyrightScheduledTest::tearDown ( )
protected

Destruct the objects initialized during setUp()

See also
PHPUnit_Framework_TestCase::tearDown()

Definition at line 91 of file schedulerTest.php.

CopyrightScheduledTest::testRun ( )

Run the test.

Test:
  1. Setup test tables
  2. Setup test repo
  3. Run copyright on upload id 1
  4. Remove test repo
  5. Check entries in copyright table

Definition at line 188 of file schedulerTest.php.

Member Data Documentation

CopyrightDao CopyrightScheduledTest::$copyrightDao
private

Object of CopyrightDao

Definition at line 68 of file schedulerTest.php.

DbManager CopyrightScheduledTest::$dbManager
private

Database manager from test database

Definition at line 52 of file schedulerTest.php.

LicenseDao CopyrightScheduledTest::$licenseDao
private

Object of LicenseDao

Definition at line 56 of file schedulerTest.php.

TestPgDb CopyrightScheduledTest::$testDb
private

Object for test database

Definition at line 48 of file schedulerTest.php.

UploadDao CopyrightScheduledTest::$uploadDao
private

Object of UploadDao

Definition at line 60 of file schedulerTest.php.

UploadPermissionDao CopyrightScheduledTest::$uploadPermDao
private

Mockery of UploadPermissionDao

Definition at line 64 of file schedulerTest.php.


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