From c14ef9fad816138fe297b07a47c0b7b5920b94cb Mon Sep 17 00:00:00 2001 From: Jens Segers Date: Sun, 27 Jul 2014 00:53:47 +0200 Subject: [PATCH] Increase coverage --- tests/ModelTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/ModelTest.php b/tests/ModelTest.php index 66c7d1e..6cbe8b9 100644 --- a/tests/ModelTest.php +++ b/tests/ModelTest.php @@ -70,6 +70,7 @@ public function testToArray() $this->assertTrue(is_array($array)); $this->assertEquals('foo', $array['name']); $this->assertFalse(isset($array['password'])); + $this->assertEquals($array, $model->jsonSerialize()); } public function testToJson() @@ -146,4 +147,14 @@ public function testArrayAccess() $this->assertEquals($model->city, $model['city']); } + public function testSerialize() + { + $model = new ModelStub; + $model->name = 'john'; + $model->foo = 10; + + $serialized = serialize($model); + $this->assertEquals($model, unserialize($serialized)); + } + }