ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 }
Class ilTermsOfServiceTableDataProviderFactoryTest.
Class ilTermsOfServiceBaseTest.
testExceptionIsRaisedWhenAcceptanceHistoryProviderIsRequestedWithoutCompleteFactoryConfiguration(ilTermsOfServiceTableDataProviderFactory $factory)
testInstanceCanBeCreated
testFactoryShouldReturnAcceptanceHistoryProviderWhenRequested(ilTermsOfServiceTableDataProviderFactory $factory)
testExceptionIsRaisedWhenUnsupportedProviderIsRequested(ilTermsOfServiceTableDataProviderFactory $factory)
testInstanceCanBeCreated
testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet(ilTermsOfServiceTableDataProviderFactory $factory)
$factory
Definition: metadata.php:58