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 ()
 ilTermsOfServiceMissingDatabaseAdapterException More...
 
 testExceptionIsRaisedWhenUnknowDataGatewayIsRequested ()
 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  {
61  $factory = new ilTermsOfServiceDataGatewayFactory();
62  $factory->setDatabaseAdapter($this->getMockBuilder('ilDBInterface')->getMock());
63  $this->assertInstanceOf('ilTermsOfServiceAcceptanceDatabaseGateway', $factory->getByName('ilTermsOfServiceAcceptanceDatabaseGateway'));
64  }

◆ testExceptionIsRaisedWhenUnknowDataGatewayIsRequested()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenUnknowDataGatewayIsRequested ( )

InvalidArgumentException

Definition at line 48 of file ilTermsOfServiceDataGatewayFactoryTest.php.

References ilTermsOfServiceBaseTest\assertException().

49  {
50  $this->assertException(InvalidArgumentException::class);
51  $factory = new ilTermsOfServiceDataGatewayFactory();
52  $factory->setDatabaseAdapter($this->getMockBuilder('ilDBInterface')->getMock());
53  $factory->getByName('PHP Unit');
54  }
+ Here is the call graph for this function:

◆ testExceptionIsRaisedWhenWhenGatewayIsRequestedWithMissingDependencies()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenWhenGatewayIsRequestedWithMissingDependencies ( )

ilTermsOfServiceMissingDatabaseAdapterException

Definition at line 38 of file ilTermsOfServiceDataGatewayFactoryTest.php.

References ilTermsOfServiceBaseTest\assertException().

39  {
40  $this->assertException(ilTermsOfServiceMissingDatabaseAdapterException::class);
41  $factory = new ilTermsOfServiceDataGatewayFactory();
42  $factory->getByName('PHP Unit');
43  }
+ 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 
73  $factory = new ilTermsOfServiceDataGatewayFactory();
74  $factory->setDatabaseAdapter($expected);
75  $this->assertEquals($expected, $factory->getDatabaseAdapter());
76  }

◆ testInstanceCanBeCreated()

ilTermsOfServiceDataGatewayFactoryTest::testInstanceCanBeCreated ( )

Definition at line 29 of file ilTermsOfServiceDataGatewayFactoryTest.php.

30  {
31  $factory = new ilTermsOfServiceDataGatewayFactory();
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: