File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
dev/tests/integration/testsuite/Magento/Customer/Controller/Account Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright 2025 Adobe
4
+ * All Rights Reserved.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Customer \Controller \Account ;
9
+
10
+ use Magento \Customer \Api \SessionCleanerInterface ;
11
+ use Magento \Customer \Model \Session ;
12
+ use Magento \TestFramework \Fixture \DataFixture ;
13
+ use Magento \TestFramework \TestCase \AbstractController ;
14
+ use PHPUnit \Framework \Attributes \CoversClass ;
15
+
16
+ #[
17
+ CoversClass(Logout::class),
18
+ ]
19
+ class LogoutTest extends AbstractController
20
+ {
21
+ /**
22
+ * @var Session
23
+ */
24
+ private $ customerSession ;
25
+
26
+ protected function setUp (): void
27
+ {
28
+ parent ::setUp ();
29
+ $ this ->customerSession = $ this ->_objectManager ->get (Session::class);
30
+ }
31
+
32
+ #[
33
+ DataFixture('Magento/Customer/_files/customer.php ' ),
34
+ ]
35
+ public function testExecute (): void
36
+ {
37
+ $ this ->customerSession ->setCustomerId ('1 ' );
38
+
39
+ $ sessionCleanerMock = $ this ->createMock (SessionCleanerInterface::class);
40
+ $ this ->_objectManager ->addSharedInstance ($ sessionCleanerMock , SessionCleanerInterface::class, true );
41
+ $ sessionCleanerMock ->expects (self ::never ())->method ('clearFor ' );
42
+
43
+ $ this ->dispatch ('customer/account/logout ' );
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments