ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTermsOfServiceTableDataProviderFactoryTest.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
15 {
17 $factory->setDatabaseAdapter($this->getMockBuilder(ilDBInterface::class)->getMock());
18
19 $this->assertInstanceOf('ilTermsOfServiceTableDataProviderFactory', $factory);
20
21 return $factory;
22 }
23
31 ) : void {
32 $this->expectException(InvalidArgumentException::class);
33
34 $factory->getByContext('PHP unit');
35 }
36
44 ) : void {
45 $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
46 $factory->setDatabaseAdapter($db);
47
48 $this->assertEquals($db, $factory->getDatabaseAdapter());
49 }
50
58 ) : void {
59 $this->expectException(ilTermsOfServiceMissingDatabaseAdapterException::class);
60
61 $factory->setDatabaseAdapter(null);
63 }
64
73 ) : void {
74 $factory->setDatabaseAdapter($this->getMockBuilder(ilDBInterface::class)->getMock());
75
76 $this->assertInstanceOf(
77 'ilTermsOfServiceAcceptanceHistoryProvider',
79 );
80 }
81}
An exception for terminatinating execution or to throw for unit testing.
Class ilTermsOfServiceBaseTest.
Class ilTermsOfServiceTableDataProviderFactoryTest.
testExceptionIsRaisedWhenUnsupportedProviderIsRequested(ilTermsOfServiceTableDataProviderFactory $factory)
@depends testInstanceCanBeCreated
testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet(ilTermsOfServiceTableDataProviderFactory $factory)
testExceptionIsRaisedWhenAcceptanceHistoryProviderIsRequestedWithoutCompleteFactoryConfiguration(ilTermsOfServiceTableDataProviderFactory $factory)
@depends testInstanceCanBeCreated
testFactoryShouldReturnAcceptanceHistoryProviderWhenRequested(ilTermsOfServiceTableDataProviderFactory $factory)
Interface ilDBInterface.
$factory
Definition: metadata.php:58