We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66be67b commit 267856bCopy full SHA for 267856b
tests/MasqueradeSecurityControllerTest.php
@@ -0,0 +1,24 @@
1
+<?php
2
+
3
+class MasqueradeSecurityControllerTest extends SapphireTest {
4
5
+ protected static $fixture_file = 'MasqueradeMemberTest.yml';
6
7
+ public function testLogout()
8
+ {
9
+ $this->logInWithPermission('ADMIN');
10
+ $admin = Member::currentUser();
11
+ $member = $this->objFromFixture('Member', 'user');
12
13
+ $member->masquerade();
14
15
+ $this->assertEquals($member->ID, Session::get('loggedInAs'));
16
+ $sc = new MasqueradeSecurityController();
17
+ $sc->init();
18
+ $sc->logout(false);
19
20
+ $this->assertEquals($admin->ID, Session::get('loggedInAs'));
21
22
+ }
23
24
+}
0 commit comments