File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
tests/TestCase/Controller Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -70,4 +70,30 @@ public function testClearCache()
7070 $ this ->assertResponseOk ();
7171 $ this ->assertResponseContains ('success ' );
7272 }
73+
74+ /**
75+ * Test clearing the session does not work with GET
76+ *
77+ * @return void
78+ */
79+ public function testClearSessionNoGet ()
80+ {
81+ $ this ->get ('/debug-kit/toolbar/clear-session ' );
82+ $ this ->assertResponseCode (405 );
83+ }
84+
85+ /**
86+ * Test clearing the session.
87+ *
88+ * @return void
89+ */
90+ public function testClearSession ()
91+ {
92+ $ this ->session (['test ' => 'value ' ]);
93+ $ this ->configRequest (['headers ' => ['Accept ' => 'application/json ' ]]);
94+ $ this ->post ('/debug-kit/toolbar/clear-session ' );
95+ $ this ->assertResponseOk ();
96+ $ this ->assertResponseContains ('success ' );
97+ $ this ->assertResponseContains ('Session cleared ' );
98+ }
7399}
You can’t perform that action at this time.
0 commit comments