ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 38 of file SlotConstructorTest.php.

Member Function Documentation

◆ testConstruct()

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

Definition at line 42 of file SlotConstructorTest.php.

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

◆ testDocument()

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

Definition at line 59 of file SlotConstructorTest.php.

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

◆ testDocumentRepository()

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

Definition at line 65 of file SlotConstructorTest.php.

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

◆ testHistory()

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

Definition at line 52 of file SlotConstructorTest.php.

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

◆ testId()

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

Definition at line 47 of file SlotConstructorTest.php.

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

◆ testReadOnlyDocuments()

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

Definition at line 71 of file SlotConstructorTest.php.

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

◆ testWithdrawalFinished()

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

Definition at line 77 of file SlotConstructorTest.php.

References $container.

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

◆ testWithdrawalFinishedWithoutQueryParam()

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

Definition at line 96 of file SlotConstructorTest.php.

References $container.

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

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