ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\LegalDocuments\test\SlotConstructorTest Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\test\SlotConstructorTest:
+ Collaboration diagram for ILIAS\LegalDocuments\test\SlotConstructorTest:

Public Member Functions

 testConstruct ()
 
 testId ()
 
 testHistory ()
 
 testDocument ()
 
 testDocumentRepository ()
 
 testReadOnlyDocuments ()
 
 testWithdrawalFinished ()
 
 testWithdrawalFinishedWithoutQueryParam ()
 

Detailed Description

Definition at line 37 of file SlotConstructorTest.php.

Member Function Documentation

◆ testConstruct()

ILIAS\LegalDocuments\test\SlotConstructorTest::testConstruct ( )

Definition at line 41 of file SlotConstructorTest.php.

41  : void
42  {
43  $this->assertInstanceOf(SlotConstructor::class, new SlotConstructor('foo', $this->mock(Container::class), $this->mock(UserAction::class)));
44  }

◆ testDocument()

ILIAS\LegalDocuments\test\SlotConstructorTest::testDocument ( )

Definition at line 58 of file SlotConstructorTest.php.

58  : void
59  {
60  $instance = new SlotConstructor('foo', $this->mock(Container::class), $this->mock(UserAction::class));
61  $this->assertInstanceOf(ProvideDocument::class, $instance->document($this->mock(DocumentRepository::class), new SelectionMap(), []));
62  }

◆ testDocumentRepository()

ILIAS\LegalDocuments\test\SlotConstructorTest::testDocumentRepository ( )

Definition at line 64 of file SlotConstructorTest.php.

64  : void
65  {
66  $instance = new SlotConstructor('foo', $this->mock(Container::class), $this->mock(UserAction::class));
67  $this->assertInstanceOf(DatabaseDocumentRepository::class, $instance->documentRepository());
68  }

◆ testHistory()

ILIAS\LegalDocuments\test\SlotConstructorTest::testHistory ( )

Definition at line 51 of file SlotConstructorTest.php.

51  : void
52  {
53  $document = $this->mockTree(ProvideDocument::class, ['repository' => $this->mock(DatabaseDocumentRepository::class)]);
54  $instance = new SlotConstructor('foo', $this->mock(Container::class), $this->mock(UserAction::class));
55  $this->assertInstanceOf(ProvideHistory::class, $instance->history($document));
56  }

◆ testId()

ILIAS\LegalDocuments\test\SlotConstructorTest::testId ( )

Definition at line 46 of file SlotConstructorTest.php.

46  : void
47  {
48  $this->assertSame('foo', (new SlotConstructor('foo', $this->mock(Container::class), $this->mock(UserAction::class)))->id());
49  }

◆ testReadOnlyDocuments()

ILIAS\LegalDocuments\test\SlotConstructorTest::testReadOnlyDocuments ( )

Definition at line 70 of file SlotConstructorTest.php.

70  : void
71  {
72  $instance = new SlotConstructor('foo', $this->mock(Container::class), $this->mock(UserAction::class));
73  $this->assertInstanceOf(ReadOnlyDocumentRepository::class, $instance->readOnlyDocuments($this->mock(DocumentRepository::class)));
74  }

◆ testWithdrawalFinished()

ILIAS\LegalDocuments\test\SlotConstructorTest::testWithdrawalFinished ( )

Definition at line 76 of file SlotConstructorTest.php.

References $container.

76  : void
77  {
78  $called = false;
79 
80  $container = $this->mockTree(Container::class, [
81  'http' => ['request' => $this->mockTree(ServerRequestInterface::class, ['getQueryParams' => ['withdrawal_finished' => 'foo']])]
82  ]);
83 
84  $instance = new SlotConstructor('foo', $container, $this->mock(UserAction::class));
85 
86  $proc = $instance->withdrawalFinished(function () use (&$called): void {
87  $called = true;
88  });
89 
90  $this->assertFalse($called);
91  $proc();
92  $this->assertTrue($called);
93  }
$container
Definition: wac.php:36

◆ testWithdrawalFinishedWithoutQueryParam()

ILIAS\LegalDocuments\test\SlotConstructorTest::testWithdrawalFinishedWithoutQueryParam ( )

Definition at line 95 of file SlotConstructorTest.php.

References $container.

95  : void
96  {
97  $called = false;
98 
99  $container = $this->mockTree(Container::class, [
100  'http' => ['request' => $this->mockTree(ServerRequestInterface::class, ['getQueryParams' => []])]
101  ]);
102 
103  $instance = new SlotConstructor('foo', $container, $this->mock(UserAction::class));
104 
105  $proc = $instance->withdrawalFinished(function () use (&$called): void {
106  $called = true;
107  });
108 
109  $this->assertFalse($called);
110  $proc();
111  $this->assertFalse($called);
112  }
$container
Definition: wac.php:36

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