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

Public Member Functions

 testConstruct ()
 
 testBeginProcessURL ()
 
 testFinishAndLogout ()
 

Detailed Description

Definition at line 32 of file ProvideWithdrawalTest.php.

Member Function Documentation

◆ testBeginProcessURL()

ILIAS\LegalDocuments\test\Provide\ProvideWithdrawalTest::testBeginProcessURL ( )

Definition at line 45 of file ProvideWithdrawalTest.php.

References $params.

45  : void
46  {
47  $instance = new ProvideWithdrawal(
48  'foo',
49  $this->mock(ilCtrl::class),
50  $this->mock(ilAuthSession::class),
51  function (array $params): string {
52  $this->assertSame(['withdraw_consent' => 'foo'], $params);
53  return 'logout url';
54  }
55  );
56 
57  $this->assertSame('logout url', $instance->beginProcessURL());
58  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31

◆ testConstruct()

ILIAS\LegalDocuments\test\Provide\ProvideWithdrawalTest::testConstruct ( )

Definition at line 36 of file ProvideWithdrawalTest.php.

36  : void
37  {
38  $this->assertInstanceOf(ProvideWithdrawal::class, new ProvideWithdrawal(
39  'foo',
40  $this->mock(ilCtrl::class),
41  $this->mock(ilAuthSession::class)
42  ));
43  }

◆ testFinishAndLogout()

ILIAS\LegalDocuments\test\Provide\ProvideWithdrawalTest::testFinishAndLogout ( )

Definition at line 60 of file ProvideWithdrawalTest.php.

References ILIAS\LegalDocuments\Provide\ProvideWithdrawal\finishAndLogout(), and ilSession\SESSION_CLOSE_USER.

60  : void
61  {
62  $called = false;
63 
64  $auth_session = $this->mock(ilAuthSession::class);
65  $auth_session->expects(self::once())->method('logout');
66 
67  $ctrl = $this->mock(ilCtrl::class);
68  $ctrl->expects(self::once())->method('redirectToURL')->with('login.php?bar=baz&withdrawal_finished=foo&cmd=force_login');
69 
70  $instance = new ProvideWithdrawal(
71  'foo',
72  $ctrl,
73  $auth_session,
74  $this->fail(...),
75  function (int $x) use (&$called) {
76  $this->assertSame(ilSession::SESSION_CLOSE_USER, $x);
77  $called = true;
78  }
79  );
80 
81  $instance->finishAndLogout(['bar' => 'baz']);
82 
83  $this->assertTrue($called);
84  }
const SESSION_CLOSE_USER
+ Here is the call graph for this function:

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