Skip to content

Commit

Permalink
Adding test for #6369
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Apr 20, 2015
1 parent def326c commit 73d4fec
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/TestCase/Network/Session/DatabaseSessionTest.php
Expand Up @@ -20,6 +20,7 @@
use Cake\Datasource\ConnectionManager;
use Cake\Network\Session;
use Cake\Network\Session\DatabaseSession;
use Cake\ORM\Entity;
use Cake\ORM\Table;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;
Expand Down Expand Up @@ -162,4 +163,18 @@ public function testGc()
$storage->gc(0);
$this->assertFalse($storage->read('foo'));
}

/**
* Tests serializing an entity
*
* @return void
*/
public function testSerializeEntity()
{
$entity = new Entity();
$entity->value = 'something';
$result = $this->storage->write('key', serialize($entity));
$data = TableRegistry::get('Sessions')->get('key')->data;
$this->assertEquals(serialize($entity), $data);
}
}

0 comments on commit 73d4fec

Please sign in to comment.