ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTermsOfServiceDataGatewayFactoryTest Class Reference

Class ilTermsOfServiceDataGatewayFactoryTest. More...

+ Inheritance diagram for ilTermsOfServiceDataGatewayFactoryTest:
+ Collaboration diagram for ilTermsOfServiceDataGatewayFactoryTest:

Public Member Functions

 testInstanceCanBeCreated ()
 
 testExceptionIsRaisedWhenGatewayIsRequestedWithMissingDependencies ()
 @expectedException \ilTermsOfServiceMissingDatabaseAdapterException More...
 
 testExceptionIsRaisedWhenUnknownDataGatewayIsRequested ()
 @expectedException \InvalidArgumentException More...
 
 testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName ()
 
 testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilTermsOfServiceBaseTest
 setUp ()
 
 getLanguageMock ()
 
 setGlobalVariable (string $name, $value)
 
 assertException (string $exceptionClass)
 
 getCriterionConfig ($value=null)
 
- Protected Attributes inherited from ilTermsOfServiceBaseTest
 $dic
 

Detailed Description

Member Function Documentation

◆ testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName()

ilTermsOfServiceDataGatewayFactoryTest::testAcceptanceDatabaseGatewayIsReturnedWhenRequestedByName ( )

Definition at line 45 of file ilTermsOfServiceDataGatewayFactoryTest.php.

46 {
47 $factory = new \ilTermsOfServiceDataGatewayFactory();
48 $factory->setDatabaseAdapter($this->getMockBuilder(\ilDBInterface::class)->getMock());
49
50 $this->assertInstanceOf(
51 'ilTermsOfServiceAcceptanceDatabaseGateway',
52 $factory->getByName('ilTermsOfServiceAcceptanceDatabaseGateway')
53 );
54 }
$factory
Definition: metadata.php:43

References $factory.

◆ testExceptionIsRaisedWhenGatewayIsRequestedWithMissingDependencies()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenGatewayIsRequestedWithMissingDependencies ( )

@expectedException \ilTermsOfServiceMissingDatabaseAdapterException

Definition at line 22 of file ilTermsOfServiceDataGatewayFactoryTest.php.

23 {
24 $this->assertException(\ilTermsOfServiceMissingDatabaseAdapterException::class);
25
26 $factory = new \ilTermsOfServiceDataGatewayFactory();
27 $factory->getByName('PHP Unit');
28 }
assertException(string $exceptionClass)

References $factory, and ilTermsOfServiceBaseTest\assertException().

+ Here is the call graph for this function:

◆ testExceptionIsRaisedWhenUnknownDataGatewayIsRequested()

ilTermsOfServiceDataGatewayFactoryTest::testExceptionIsRaisedWhenUnknownDataGatewayIsRequested ( )

@expectedException \InvalidArgumentException

Definition at line 33 of file ilTermsOfServiceDataGatewayFactoryTest.php.

34 {
35 $this->assertException(\InvalidArgumentException::class);
36
37 $factory = new \ilTermsOfServiceDataGatewayFactory();
38 $factory->setDatabaseAdapter($this->getMockBuilder(\ilDBInterface::class)->getMock());
39 $factory->getByName('PHP Unit');
40 }

References $factory, and ilTermsOfServiceBaseTest\assertException().

+ Here is the call graph for this function:

◆ testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet()

ilTermsOfServiceDataGatewayFactoryTest::testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet ( )

Definition at line 59 of file ilTermsOfServiceDataGatewayFactoryTest.php.

60 {
61 $expected = $this->getMockBuilder(\ilDBInterface::class)->getMock();
62
63 $factory = new \ilTermsOfServiceDataGatewayFactory();
64 $factory->setDatabaseAdapter($expected);
65
66 $this->assertEquals($expected, $factory->getDatabaseAdapter());
67 }

References $factory.

◆ testInstanceCanBeCreated()

ilTermsOfServiceDataGatewayFactoryTest::testInstanceCanBeCreated ( )

Definition at line 13 of file ilTermsOfServiceDataGatewayFactoryTest.php.

14 {
15 $factory = new \ilTermsOfServiceDataGatewayFactory();
16 $this->assertInstanceOf('ilTermsOfServiceDataGatewayFactory', $factory);
17 }

References $factory.


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