From dd5960ad89a540334bcfa8e7e524f477d99a66d1 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Sun, 31 Mar 2019 19:04:42 -0400 Subject: [PATCH 1/2] Added `getHandler` for easier testing --- src/Session.php | 8 ++++++++ tests/SessionTest.php | 10 ++++++++++ 2 files changed, 18 insertions(+) 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 * From 57b2a9cd831334de836330be8b6519d348fc2b81 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Mon, 15 Apr 2019 21:20:50 -0400 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) 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