ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTermsOfServiceDataGatewayFactoryTest Class Reference
+ Inheritance diagram for ilTermsOfServiceDataGatewayFactoryTest:
+ Collaboration diagram for ilTermsOfServiceDataGatewayFactoryTest:

Public Member Functions

 setUp ()
 
 testInstanceCanBeCreated ()
 
 testExceptionIsRaisedWhenWhenGatewayIsRequestedWithMissingDependencies ()
 @expectedException ilTermsOfServiceMissingDatabaseAdapterException More...
 
 testExceptionIsRaisedWhenUnknowDataGatewayIsRequested ()
 @expectedException InvalidArgumentException More...
 
 testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName ()
 
 testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet ()
 

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 ilTermsOfServiceDataGatewayFactoryTest.php.

Member Function Documentation

◆ setUp()

ilTermsOfServiceDataGatewayFactoryTest::setUp ( )

Definition at line 21 of file ilTermsOfServiceDataGatewayFactoryTest.php.

22 {
23 parent::setUp();
24 }

◆ testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName()

ilTermsOfServiceDataGatewayFactoryTest::testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName ( )

Definition at line 59 of file ilTermsOfServiceDataGatewayFactoryTest.php.

60 {
62 $factory->setDatabaseAdapter($this->getMockBuilder('ilDBInterface')->getMock());
63 $this->assertInstanceOf('ilTermsOfServiceAcceptanceDatabaseGateway', $factory->getByName('ilTermsOfServiceAcceptanceDatabaseGateway'));
64 }

◆ testExceptionIsRaisedWhenUnknowDataGatewayIsRequested()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenUnknowDataGatewayIsRequested ( )

@expectedException InvalidArgumentException

Definition at line 48 of file ilTermsOfServiceDataGatewayFactoryTest.php.

49 {
50 $this->assertException(InvalidArgumentException::class);
52 $factory->setDatabaseAdapter($this->getMockBuilder('ilDBInterface')->getMock());
53 $factory->getByName('PHP Unit');
54 }

References ilTermsOfServiceBaseTest\assertException().

+ Here is the call graph for this function:

◆ testExceptionIsRaisedWhenWhenGatewayIsRequestedWithMissingDependencies()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenWhenGatewayIsRequestedWithMissingDependencies ( )

@expectedException ilTermsOfServiceMissingDatabaseAdapterException

Definition at line 38 of file ilTermsOfServiceDataGatewayFactoryTest.php.

39 {
40 $this->assertException(ilTermsOfServiceMissingDatabaseAdapterException::class);
42 $factory->getByName('PHP Unit');
43 }

References ilTermsOfServiceBaseTest\assertException().

+ Here is the call graph for this function:

◆ testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet()

ilTermsOfServiceDataGatewayFactoryTest::testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet ( )

Definition at line 69 of file ilTermsOfServiceDataGatewayFactoryTest.php.

70 {
71 $expected = $this->getMockBuilder('ilDBInterface')->getMock();
72
74 $factory->setDatabaseAdapter($expected);
75 $this->assertEquals($expected, $factory->getDatabaseAdapter());
76 }

◆ testInstanceCanBeCreated()

ilTermsOfServiceDataGatewayFactoryTest::testInstanceCanBeCreated ( )

Definition at line 29 of file ilTermsOfServiceDataGatewayFactoryTest.php.

30 {
32 $this->assertInstanceOf('ilTermsOfServiceDataGatewayFactory', $factory);
33 }

Field Documentation

◆ $backupGlobals

ilTermsOfServiceDataGatewayFactoryTest::$backupGlobals = false
protected

Definition at line 16 of file ilTermsOfServiceDataGatewayFactoryTest.php.


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