ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\LegalDocuments\test\ProvideTest Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\test\ProvideTest:
+ Collaboration diagram for ILIAS\LegalDocuments\test\ProvideTest:

Public Member Functions

 testConstruct ()
 
 testWithdrawal ()
 
 testPublicPage ()
 
 testDocument ()
 
 testHistory ()
 
 testAllowEditing ()
 
 testPublicApi ()
 
 testId ()
 

Detailed Description

Definition at line 38 of file ProvideTest.php.

Member Function Documentation

◆ testAllowEditing()

ILIAS\LegalDocuments\test\ProvideTest::testAllowEditing ( )

Definition at line 87 of file ProvideTest.php.

87  : void
88  {
89  $document = $this->mock(ProvideDocument::class);
90 
91  $internal = $this->mock(Internal::class);
92  $internal->expects(self::exactly(2))->method('get')->withConsecutive(['document', 'foo'], ['writable-document', 'foo'])->willReturn($document);
93 
94  $instance = new Provide('foo', $internal, $this->mock(Container::class));
95  $instance->document();
96  $instance->allowEditing()->document();
97  }

◆ testConstruct()

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

Definition at line 42 of file ProvideTest.php.

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

◆ testDocument()

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

Definition at line 69 of file ProvideTest.php.

69  : void
70  {
71  $document = $this->mock(ProvideDocument::class);
72  $internal = $this->mockMethod(Internal::class, 'get', ['document', 'foo'], $document);
73 
74  $instance = new Provide('foo', $internal, $this->mock(Container::class));
75  $this->assertSame($document, $instance->document());
76  }

◆ testHistory()

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

Definition at line 78 of file ProvideTest.php.

78  : void
79  {
80  $history = $this->mock(ProvideHistory::class);
81  $internal = $this->mockMethod(Internal::class, 'get', ['history', 'foo'], $history);
82 
83  $instance = new Provide('foo', $internal, $this->mock(Container::class));
84  $this->assertSame($history, $instance->history());
85  }

◆ testId()

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

Definition at line 109 of file ProvideTest.php.

109  : void
110  {
111  $this->assertSame('foo', (new Provide('foo', $this->mock(Internal::class), $this->mock(Container::class)))->id());
112  }

◆ testPublicApi()

ILIAS\LegalDocuments\test\ProvideTest::testPublicApi ( )

Definition at line 99 of file ProvideTest.php.

99  : void
100  {
101  $public_api = $this->mock(PublicApi::class);
102  $internal = $this->mockMethod(Internal::class, 'get', ['public-api', 'foo'], $public_api);
103 
104  $instance = new Provide('foo', $internal, $this->mock(Container::class));
105 
106  $this->assertSame($public_api, $instance->publicApi());
107  }

◆ testPublicPage()

ILIAS\LegalDocuments\test\ProvideTest::testPublicPage ( )

Definition at line 57 of file ProvideTest.php.

References $container.

57  : void
58  {
59  $container = $this->mockTree(Container::class, ['ctrl' => $this->mock(ilCtrl::class)]);
60 
61  $this->assertInstanceOf(ProvidePublicPage::class, (new Provide('foo', $this->mockMethod(
62  Internal::class,
63  'get',
64  ['public-page', 'foo'],
65  true
66  ), $container))->publicPage());
67  }
$container
Definition: wac.php:14

◆ testWithdrawal()

ILIAS\LegalDocuments\test\ProvideTest::testWithdrawal ( )

Definition at line 47 of file ProvideTest.php.

References $container.

47  : void
48  {
49  $container = $this->mockTree(Container::class, ['ctrl' => $this->mock(ilCtrl::class)]);
50  $container->expects(self::once())->method('offsetGet')->with('ilAuthSession')->willReturn($this->mock(ilAuthSession::class));
51 
52  $instance = new Provide('foo', $this->mockMethod(Internal::class, 'get', ['withdraw'], 'foo'), $container);
53 
54  $this->assertInstanceOf(ProvideWithdrawal::class, $instance->withdrawal());
55  }
$container
Definition: wac.php:14

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