Skip to content

Commit

Permalink
Execute CakeSession::destroy() on a tearDown with implicit use sessio…
Browse files Browse the repository at this point in the history
…n test
  • Loading branch information
tenkoma committed Jan 15, 2018
1 parent f07d193 commit 701519c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
Expand Up @@ -415,6 +415,7 @@ public function tearDown() {
TestAuthComponent::clearUser();
$this->Auth->Session->delete('Auth');
$this->Auth->Session->delete('Message.auth');
$this->Auth->Session->destroy();
unset($this->Controller, $this->Auth);
}

Expand Down
Expand Up @@ -186,6 +186,7 @@ public function setUp() {
public function tearDown() {
parent::tearDown();
$this->Controller->Session->delete('_Token');
$this->Controller->Session->destroy();
unset($this->Controller->Security);
unset($this->Controller->Component);
unset($this->Controller);
Expand Down
2 changes: 2 additions & 0 deletions lib/Cake/Test/Case/Controller/ScaffoldTest.php
Expand Up @@ -17,6 +17,7 @@
*/

App::uses('Router', 'Routing');
App::uses('CakeSession', 'Model/Datasource');
App::uses('Controller', 'Controller');
App::uses('Scaffold', 'Controller');
App::uses('ScaffoldView', 'View');
Expand Down Expand Up @@ -175,6 +176,7 @@ public function setUp() {
*/
public function tearDown() {
parent::tearDown();
CakeSession::destroy();
unset($this->Controller);
}

Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Test/Case/I18n/I18nTest.php
Expand Up @@ -51,6 +51,7 @@ public function tearDown() {
parent::tearDown();

Cache::delete('object_map', '_cake_core_');
CakeSession::destroy();
App::build();
CakePlugin::unload();
}
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Test/Case/View/Helper/SessionHelperTest.php
Expand Up @@ -87,6 +87,7 @@ public function setUp() {
public function tearDown() {
$_SESSION = array();
unset($this->View, $this->Session);
CakeSession::destroy();
CakePlugin::unload();
parent::tearDown();
}
Expand Down

0 comments on commit 701519c

Please sign in to comment.