ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 

Detailed Description

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

Definition at line 10 of file ilTermsOfServiceDataGatewayFactoryTest.php.

Member Function Documentation

◆ setUp()

ilTermsOfServiceDataGatewayFactoryTest::setUp ( )

Definition at line 20 of file ilTermsOfServiceDataGatewayFactoryTest.php.

21 {
22 if(!defined('MDB2_AUTOQUERY_INSERT'))
23 {
24 define('MDB2_AUTOQUERY_INSERT', 1);
25 }
26
27 parent::setUp();
28 }

◆ testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName()

ilTermsOfServiceDataGatewayFactoryTest::testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName ( )

Definition at line 61 of file ilTermsOfServiceDataGatewayFactoryTest.php.

62 {
64 $factory->setDatabaseAdapter($this->getMockBuilder('ilDB')->disableOriginalConstructor()->getMock());
65 $this->assertInstanceOf('ilTermsOfServiceAcceptanceDatabaseGateway', $factory->getByName('ilTermsOfServiceAcceptanceDatabaseGateway'));
66 }

◆ testExceptionIsRaisedWhenUnknowDataGatewayIsRequested()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenUnknowDataGatewayIsRequested ( )

@expectedException InvalidArgumentException

Definition at line 51 of file ilTermsOfServiceDataGatewayFactoryTest.php.

52 {
54 $factory->setDatabaseAdapter($this->getMockBuilder('ilDB')->disableOriginalConstructor()->getMock());
55 $factory->getByName('PHP Unit');
56 }

◆ testExceptionIsRaisedWhenWhenGatewayIsRequestedWithMissingDependencies()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenWhenGatewayIsRequestedWithMissingDependencies ( )

@expectedException ilTermsOfServiceMissingDatabaseAdapterException

Definition at line 42 of file ilTermsOfServiceDataGatewayFactoryTest.php.

43 {
45 $factory->getByName('PHP Unit');
46 }

◆ testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet()

ilTermsOfServiceDataGatewayFactoryTest::testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet ( )

Definition at line 71 of file ilTermsOfServiceDataGatewayFactoryTest.php.

72 {
73 $expected = $this->getMockBuilder('ilDB')->disableOriginalConstructor()->getMock();
74
76 $factory->setDatabaseAdapter($expected);
77 $this->assertEquals($expected, $factory->getDatabaseAdapter());
78 }

◆ testInstanceCanBeCreated()

ilTermsOfServiceDataGatewayFactoryTest::testInstanceCanBeCreated ( )

Definition at line 33 of file ilTermsOfServiceDataGatewayFactoryTest.php.

34 {
36 $this->assertInstanceOf('ilTermsOfServiceDataGatewayFactory', $factory);
37 }

Field Documentation

◆ $backupGlobals

ilTermsOfServiceDataGatewayFactoryTest::$backupGlobals = false
protected

Definition at line 15 of file ilTermsOfServiceDataGatewayFactoryTest.php.


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