Skip to content
Snippets Groups Projects
Unverified Commit 8146809d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3172757 by Erik Frèrejean, raman.b: Session manager destroy misses isCli check

(cherry picked from commit 86ef18f1ceecc618bf44ea6b7cb0adca5ea974d2)
parent b794a339
No related branches found
No related tags found
6 merge requests!1286issue #3240655 by elfakhar,!1285Issue #3240655 by elfakhar Aligne the active border,!541Issue #3123070: Fix 'PSR2.Classes.PropertyDeclaration.Underscore' coding standard,!463Resolve #3205025 "Class align center for media",!386Allow multiple vocabularies in the taxonomy filter,!308Issue #3118206: Remote media does not validate provider
...@@ -257,6 +257,10 @@ public function delete($uid) { ...@@ -257,6 +257,10 @@ public function delete($uid) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function destroy() { public function destroy() {
if ($this->isCli()) {
return;
}
session_destroy(); session_destroy();
// Unset the session cookies. // Unset the session cookies.
......
<?php
namespace Drupal\KernelTests\Core\Session;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests starting and destroying a session from the CLI.
*
* @group Session
*/
class SessionManagerDestroyNoCliCheckTest extends KernelTestBase {
/**
* Tests starting and destroying a session from the CLI.
*/
public function testCallSessionManagerStartAndDestroy() {
$this->assertFalse(\Drupal::service('session_manager')->start());
$this->assertNull(\Drupal::service('session_manager')->destroy());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment