diff --git a/CHANGELOG.md b/CHANGELOG.md index 28def4d..aa8ce92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [4.2.2] +- Added `getHandler` to the Session class for easier testing + ## [4.2.1] - Added additional configuration option `cookie_parameters` ([#4]) - Added `getId` method. @@ -26,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [#4]: https://github.com/userfrosting/session/pull/4 +[4.2.2]: https://github.com/userfrosting/session/compare/4.2.1...4.2.2 [4.2.1]: https://github.com/userfrosting/session/compare/4.2.0...4.2.1 [4.2.0]: https://github.com/userfrosting/session/compare/4.1.0...4.2.0 [4.1.0]: https://github.com/userfrosting/session/compare/4.0.1...4.1.0 diff --git a/src/Session.php b/src/Session.php index 7dfb42b..5d40cdf 100644 --- a/src/Session.php +++ b/src/Session.php @@ -268,4 +268,12 @@ public function offsetUnset($key) { $this->set($key, null); } + + /** + * @return SessionHandlerInterface + */ + public function getHandler() + { + return $this->handler; + } } diff --git a/tests/SessionTest.php b/tests/SessionTest.php index 2a2394a..4ea1988 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -40,6 +40,16 @@ public function testConstructor() return $session; } + /** + * @depends testConstructor + * + * @param Session $session + */ + public function testGetHandler(Session $session) + { + $this->assertEquals($this->handler, $session->getHandler()); + } + /** * @depends testConstructor *