Commit graph php-sdk/tests/Unit/Server/Session/FileSessionStoreTest.php
Author SHA1 Message Date
Christopher Hertel
c36e805086
[Server] Restrict FileSessionStore::gc() to owned session files (#479) 2026-08-25 00:43:08 +02:00
Christopher Hertel
a987a3a248
[Server] Throw the SDK's own RuntimeException from FileSessionStore (#404)
The constructor guarded its unwritable-directory case with the global
`\RuntimeException`, the only throw in `src/` still outside
`Mcp\Exception\ExceptionInterface`. A consumer wrapping server setup in a
`catch (ExceptionInterface)` missed it and got an unhandled SPL exception on
a misconfigured session directory instead.

`Mcp\Exception\RuntimeException` extends `\RuntimeException`, so this is
additive: existing `catch (\RuntimeException)` blocks keep working.

The constructor had no test coverage at all, so this adds one for the throw
plus the directory-creation and write/read paths around it.
2026-08-14 21:29:26 +02:00