mxmbsocket/tests/unit/Session/Serialize/PhpHandlerTest.php
Mohamad Faeez 50725bbf4c
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
major update
2025-04-09 14:56:59 +08:00

44 lines
1.2 KiB
PHP

<?php
namespace mfmdevsystem\socket\Session\Serialize;
use mfmdevsystem\socket\Session\Serialize\PhpHandler;
/**
* @covers Ratchet\Session\Serialize\PhpHandler
*/
class PhpHandlerTest extends \PHPUnit_Framework_TestCase {
protected $_handler;
public function setUp() {
$this->_handler = new PhpHandler;
}
public function serializedProvider() {
return array(
array(
'_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}'
, array(
'_sf2_attributes' => array(
'hello' => 'world'
, 'last' => 1332872102
)
, '_sf2_flashes' => array()
)
)
);
}
/**
* @dataProvider serializedProvider
*/
public function testUnserialize($in, $expected) {
$this->assertEquals($expected, $this->_handler->unserialize($in));
}
/**
* @dataProvider serializedProvider
*/
public function testSerialize($serialized, $original) {
$this->assertEquals($serialized, $this->_handler->serialize($original));
}
}