From 4fec952d6cc3120adc55eb2baa29d8853498b618 Mon Sep 17 00:00:00 2001 From: Vivek Dinesh Date: Tue, 23 May 2017 19:53:51 +0530 Subject: [PATCH] Adds test for session set magic method --- tests/system/Session/SessionTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/system/Session/SessionTest.php b/tests/system/Session/SessionTest.php index c06d123a7e3e..50fda44a04b7 100644 --- a/tests/system/Session/SessionTest.php +++ b/tests/system/Session/SessionTest.php @@ -175,6 +175,17 @@ public function testHasReturnsCanRemoveArray() $this->assertFalse(isset($_SESSION['bar'])); } + public function testSetMagicMethod() + { + $session = $this->getInstance(); + $session->start(); + + $session->foo = 'bar'; + + $this->assertTrue(isset($_SESSION['foo'])); + $this->assertEquals('bar', $_SESSION['foo']); + } + public function testCanFlashData() { $session = $this->getInstance();