Codeception / Codeception/module-phalcon4

SessionManager methods missing

未关闭
#13 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
3
派生
8
PR 合并指标
30 天内没有已合并 PR

描述

When my tests tried to run a test that involved a session destroy, I got an error. Because `MemorySession.php` doesn't actually start the session using `session_start`, `session_destroy` doesn't work either.

Also, `MemorySession.php`'s get and set methods aren't actually used, because the get and set are called from `SessionManager.php`.

I fixed this by adding methods to `SessionManager.php`:

```php
class SessionManager extends Manager
{
//...

public function destroy(): void
{
$this->getAdapter()->destroy($this->getId());
}

public function get(string $key, $defaultValue = null, bool $remove = false)
{
return $this->getAdapter()->get($key, $defaultValue, $remove);
}

public function set(string $key, $value): void
{
$this->getAdapter()->set($key, $value);
}
}

```

Please let me know if this is correct, or if I'm missing something.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。