ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceTableDataProviderFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28  {
30  $factory->setDatabaseAdapter($this->getMockBuilder(ilDBInterface::class)->getMock());
31 
32  $this->assertInstanceOf(ilTermsOfServiceTableDataProviderFactory::class, $factory);
33 
34  return $factory;
35  }
36 
43  ): void {
44  $this->expectException(InvalidArgumentException::class);
45 
46  $factory->getByContext('PHP unit');
47  }
48 
55  ): void {
56  $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
57  $factory->setDatabaseAdapter($db);
58 
59  $this->assertSame($db, $factory->getDatabaseAdapter());
60  }
61 
68  ): void {
69  $this->expectException(ilTermsOfServiceMissingDatabaseAdapterException::class);
70 
71  $factory->setDatabaseAdapter(null);
73  }
74 
81  ): void {
82  $factory->setDatabaseAdapter($this->getMockBuilder(ilDBInterface::class)->getMock());
83 
84  $this->assertInstanceOf(
85  ilTermsOfServiceAcceptanceHistoryProvider::class,
87  );
88  }
89 }
Class ilTermsOfServiceTableDataProviderFactoryTest.
Class ilTermsOfServiceBaseTest.
testExceptionIsRaisedWhenAcceptanceHistoryProviderIsRequestedWithoutCompleteFactoryConfiguration(ilTermsOfServiceTableDataProviderFactory $factory)
testInstanceCanBeCreated
testFactoryShouldReturnAcceptanceHistoryProviderWhenRequested(ilTermsOfServiceTableDataProviderFactory $factory)
testExceptionIsRaisedWhenUnsupportedProviderIsRequested(ilTermsOfServiceTableDataProviderFactory $factory)
testInstanceCanBeCreated
testFactoryShouldReturnDatabaseAdapterWhenDatabaseAdapterIsSet(ilTermsOfServiceTableDataProviderFactory $factory)
$factory
Definition: metadata.php:75