/** * @covers spriebsch\session\AbstractSession::destroy */ public function testDestroyCallsDestroyInBackend() { $this->session->configure($this->sessionName, $this->sessionDomain); $this->session->start(); $this->session->setFoo('a-value'); $this->backend->expects($this->once())->method('destroy'); $this->session->destroy(); }
/** * @covers spriebsch\session\PhpSessionBackend::destroy */ public function testDestroySetsCookie() { if (!in_array('xdebug', get_loaded_extensions())) { $this->markTestSkipped('xdebug not available'); } $this->backend->startSession($this->sessionName, 300, '/', '.example.com'); $this->backend->destroy(); $headers = xdebug_get_headers(); $header = array_pop($headers); $this->assertContains('Set-Cookie:', $header); $this->assertContains($this->sessionName . '=deleted', $header); }
/** * @covers spriebsch\session\PhpSessionBackend::destroy */ public function testDestroyDestroysSession() { $this->backend->startSession('', '', '', ''); $this->backend->destroy(); $this->assertEmpty($this->backend->getSessionId()); }