ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTermsOfServiceTableDataProviderFactoryTest Class Reference
+ Inheritance diagram for ilTermsOfServiceTableDataProviderFactoryTest:
+ Collaboration diagram for ilTermsOfServiceTableDataProviderFactoryTest:

Public Member Functions

 setUp ()
 
 testInstanceCanBeCreated ()
 
 testExceptionIsRaisedWhenUnsupportedProviderIsRequested (ilTermsOfServiceTableDataProviderFactory $factory)
 testInstanceCanBeCreated More...
 
 testFactoryShouldReturnLanguageAdapterWhenLanguageAdapterIsSet (ilTermsOfServiceTableDataProviderFactory $factory)
 
 testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet (ilTermsOfServiceTableDataProviderFactory $factory)
 
 testExceptionIsRaisedWhenAgreementByLanguageProviderIsRequestedWithoutCompleteFactoryConfiguration (ilTermsOfServiceTableDataProviderFactory $factory)
 testInstanceCanBeCreated More...
 
 testExceptionIsRaisedWhenAcceptanceHistoryProviderIsRequestedWithoutCompleteFactoryConfiguration (ilTermsOfServiceTableDataProviderFactory $factory)
 testInstanceCanBeCreated More...
 
 testFactoryShouldReturnAgreementByLanguageProviderWhenRequested (ilTermsOfServiceTableDataProviderFactory $factory)
 
 testFactoryShouldReturnAcceptanceHistoryProviderWhenRequested (ilTermsOfServiceTableDataProviderFactory $factory)
 

Protected Attributes

 $backupGlobals = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilTermsOfServiceBaseTest
 assertException ($exception_class)
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 11 of file ilTermsOfServiceTableDataProviderFactoryTest.php.

Member Function Documentation

◆ setUp()

ilTermsOfServiceTableDataProviderFactoryTest::setUp ( )

Definition at line 21 of file ilTermsOfServiceTableDataProviderFactoryTest.php.

References defined.

22  {
23  if (!defined('CLIENT_ID')) {
24  define('CLIENT_ID', 'phpunit');
25  }
26 
27  parent::setUp();
28  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ testExceptionIsRaisedWhenAcceptanceHistoryProviderIsRequestedWithoutCompleteFactoryConfiguration()

ilTermsOfServiceTableDataProviderFactoryTest::testExceptionIsRaisedWhenAcceptanceHistoryProviderIsRequestedWithoutCompleteFactoryConfiguration ( ilTermsOfServiceTableDataProviderFactory  $factory)

◆ testExceptionIsRaisedWhenAgreementByLanguageProviderIsRequestedWithoutCompleteFactoryConfiguration()

ilTermsOfServiceTableDataProviderFactoryTest::testExceptionIsRaisedWhenAgreementByLanguageProviderIsRequestedWithoutCompleteFactoryConfiguration ( ilTermsOfServiceTableDataProviderFactory  $factory)

◆ testExceptionIsRaisedWhenUnsupportedProviderIsRequested()

ilTermsOfServiceTableDataProviderFactoryTest::testExceptionIsRaisedWhenUnsupportedProviderIsRequested ( ilTermsOfServiceTableDataProviderFactory  $factory)

testInstanceCanBeCreated

Parameters
ilTermsOfServiceTableDataProviderFactory$factoryInvalidArgumentException

Definition at line 47 of file ilTermsOfServiceTableDataProviderFactoryTest.php.

References ilTermsOfServiceBaseTest\assertException(), and ilTermsOfServiceTableDataProviderFactory\getByContext().

48  {
49  $this->assertException(InvalidArgumentException::class);
50  $factory->getByContext('PHP unit');
51  }
+ Here is the call graph for this function:

◆ testFactoryShouldReturnAcceptanceHistoryProviderWhenRequested()

ilTermsOfServiceTableDataProviderFactoryTest::testFactoryShouldReturnAcceptanceHistoryProviderWhenRequested ( ilTermsOfServiceTableDataProviderFactory  $factory)

◆ testFactoryShouldReturnAgreementByLanguageProviderWhenRequested()

ilTermsOfServiceTableDataProviderFactoryTest::testFactoryShouldReturnAgreementByLanguageProviderWhenRequested ( ilTermsOfServiceTableDataProviderFactory  $factory)
Parameters
ilTermsOfServiceTableDataProviderFactory$factorytestInstanceCanBeCreated

Definition at line 103 of file ilTermsOfServiceTableDataProviderFactoryTest.php.

References array, ilTermsOfServiceTableDataProviderFactory\CONTEXT_AGRREMENT_BY_LANGUAGE, ilTermsOfServiceTableDataProviderFactory\getByContext(), and ilTermsOfServiceTableDataProviderFactory\setLanguageAdapter().

104  {
105  $factory->setLanguageAdapter($this->getMockBuilder('ilLanguage')->setMethods(array('toJSON', 'getInstalledLanguages'))->disableOriginalConstructor()->getMock());
106  $this->assertInstanceOf('ilTermsOfServiceAgreementByLanguageProvider', $factory->getByContext(ilTermsOfServiceTableDataProviderFactory::CONTEXT_AGRREMENT_BY_LANGUAGE));
107  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet()

ilTermsOfServiceTableDataProviderFactoryTest::testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet ( ilTermsOfServiceTableDataProviderFactory  $factory)
Parameters
ilTermsOfServiceTableDataProviderFactory$factorytestInstanceCanBeCreated

Definition at line 68 of file ilTermsOfServiceTableDataProviderFactoryTest.php.

References ilTermsOfServiceTableDataProviderFactory\getDatabaseAdapter(), and ilTermsOfServiceTableDataProviderFactory\setDatabaseAdapter().

69  {
70  $db = $this->getMockBuilder('ilDBInterface')->getMock();
71  $factory->setDatabaseAdapter($db);
72  $this->assertEquals($db, $factory->getDatabaseAdapter());
73  }
+ Here is the call graph for this function:

◆ testFactoryShouldReturnLanguageAdapterWhenLanguageAdapterIsSet()

ilTermsOfServiceTableDataProviderFactoryTest::testFactoryShouldReturnLanguageAdapterWhenLanguageAdapterIsSet ( ilTermsOfServiceTableDataProviderFactory  $factory)
Parameters
ilTermsOfServiceTableDataProviderFactory$factorytestInstanceCanBeCreated

Definition at line 57 of file ilTermsOfServiceTableDataProviderFactoryTest.php.

References $lng, array, ilTermsOfServiceTableDataProviderFactory\getLanguageAdapter(), and ilTermsOfServiceTableDataProviderFactory\setLanguageAdapter().

58  {
59  $lng = $this->getMockBuilder('ilLanguage')->setMethods(array('toJSON', 'getInstalledLanguages'))->disableOriginalConstructor()->getMock();
60  $factory->setLanguageAdapter($lng);
61  $this->assertEquals($lng, $factory->getLanguageAdapter());
62  }
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ testInstanceCanBeCreated()

ilTermsOfServiceTableDataProviderFactoryTest::testInstanceCanBeCreated ( )
Returns
ilTermsOfServiceTableDataProviderFactory

Definition at line 33 of file ilTermsOfServiceTableDataProviderFactoryTest.php.

References $factory, and array.

34  {
36  $this->assertInstanceOf('ilTermsOfServiceTableDataProviderFactory', $factory);
37  $factory->setDatabaseAdapter($this->getMockBuilder('ilDBInterface')->getMock());
38  $factory->setLanguageAdapter($this->getMockBuilder('ilLanguage')->setMethods(array('toJSON', 'getInstalledLanguages', 'getLangKey', 'getDefaultLanguage'))->disableOriginalConstructor()->getMock());
39  return $factory;
40  }
$factory
Definition: metadata.php:47
Create styles array
The data for the language used.

Field Documentation

◆ $backupGlobals

ilTermsOfServiceTableDataProviderFactoryTest::$backupGlobals = false
protected

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