Added unit tests for serialize, formatting
This commit is contained in:
parent
1028c03235
commit
f5e8a18341
@ -14,7 +14,7 @@ class PhpHandler implements HandlerInterface {
|
|||||||
foreach ($data as $bucket => $bucketData) {
|
foreach ($data as $bucket => $bucketData) {
|
||||||
$preSerialized[] = $bucket . '|' . serialize($bucketData);
|
$preSerialized[] = $bucket . '|' . serialize($bucketData);
|
||||||
}
|
}
|
||||||
$serialized = implode('',$preSerialized);
|
$serialized = implode('', $preSerialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $serialized;
|
return $serialized;
|
||||||
|
@ -33,4 +33,11 @@ class PhpHandlerTest extends \PHPUnit_Framework_TestCase {
|
|||||||
public function testUnserialize($in, $expected) {
|
public function testUnserialize($in, $expected) {
|
||||||
$this->assertEquals($expected, $this->_handler->unserialize($in));
|
$this->assertEquals($expected, $this->_handler->unserialize($in));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider serializedProvider
|
||||||
|
*/
|
||||||
|
public function testSerialize($serialized, $original) {
|
||||||
|
$this->assertEquals($serialized, $this->_handler->serialize($original));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user