ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTermsOfServiceEntityFactoryTest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceEntityFactory.php';
5 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceDataGatewayFactory.php';
6 require_once 'Services/TermsOfService/test/ilTermsOfServiceBaseTest.php';
7 
13 {
17  protected $backupGlobals = false;
18 
22  public function setUp()
23  {
24  parent::setUp();
25  }
26 
30  public function testInstanceCanBeCreated()
31  {
32  $factory = new ilTermsOfServiceEntityFactory();
33  $this->assertInstanceOf('ilTermsOfServiceEntityFactory', $factory);
34  }
35 
40  {
41  $this->assertException(InvalidArgumentException::class);
42  $factory = new ilTermsOfServiceEntityFactory();
43  $factory->getByName('PHP Unit');
44  }
45 
50  {
51  $factory = new ilTermsOfServiceEntityFactory();
52  $this->assertInstanceOf('ilTermsOfServiceAcceptanceEntity', $factory->getByName('ilTermsOfServiceAcceptanceEntity'));
53  }
54 }
testExceptionIsRaisedWhenUnknowEntityIsRequested()
InvalidArgumentException