Execute CakeSession::destroy() on a tearDown with implicit use session test

This commit is contained in:
Koji Tanaka 2018-01-16 00:43:16 +09:00
parent f07d193ded
commit 701519c637
5 changed files with 6 additions and 0 deletions

View file

@ -415,6 +415,7 @@ class AuthComponentTest extends CakeTestCase {
TestAuthComponent::clearUser(); TestAuthComponent::clearUser();
$this->Auth->Session->delete('Auth'); $this->Auth->Session->delete('Auth');
$this->Auth->Session->delete('Message.auth'); $this->Auth->Session->delete('Message.auth');
$this->Auth->Session->destroy();
unset($this->Controller, $this->Auth); unset($this->Controller, $this->Auth);
} }

View file

@ -186,6 +186,7 @@ class SecurityComponentTest extends CakeTestCase {
public function tearDown() { public function tearDown() {
parent::tearDown(); parent::tearDown();
$this->Controller->Session->delete('_Token'); $this->Controller->Session->delete('_Token');
$this->Controller->Session->destroy();
unset($this->Controller->Security); unset($this->Controller->Security);
unset($this->Controller->Component); unset($this->Controller->Component);
unset($this->Controller); unset($this->Controller);

View file

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

View file

@ -51,6 +51,7 @@ class I18nTest extends CakeTestCase {
parent::tearDown(); parent::tearDown();
Cache::delete('object_map', '_cake_core_'); Cache::delete('object_map', '_cake_core_');
CakeSession::destroy();
App::build(); App::build();
CakePlugin::unload(); CakePlugin::unload();
} }

View file

@ -87,6 +87,7 @@ class SessionHelperTest extends CakeTestCase {
public function tearDown() { public function tearDown() {
$_SESSION = array(); $_SESSION = array();
unset($this->View, $this->Session); unset($this->View, $this->Session);
CakeSession::destroy();
CakePlugin::unload(); CakePlugin::unload();
parent::tearDown(); parent::tearDown();
} }