3 use Wikimedia\TestingAccessWrapper
;
8 class RedisBagOStuffTest
extends PHPUnit_Framework_TestCase
{
9 /** @var RedisBagOStuff */
12 protected function setUp() {
14 $cache = $this->getMockBuilder( 'RedisBagOStuff' )
15 ->disableOriginalConstructor()
17 $this->cache
= TestingAccessWrapper
::newFromObject( $cache );
21 * @covers RedisBagOStuff::unserialize
22 * @dataProvider unserializeProvider
24 public function testUnserialize( $expected, $input, $message ) {
25 $actual = $this->cache
->unserialize( $input );
26 $this->assertSame( $expected, $actual, $message );
29 public function unserializeProvider() {
34 'String representation of \'-1\'',
39 'String representation of \'0\'',
44 'String representation of \'1\'',
49 'Serialized negative double',
60 * @covers RedisBagOStuff::serialize
61 * @dataProvider serializeProvider
63 public function testSerialize( $expected, $input, $message ) {
64 $actual = $this->cache
->serialize( $input );
65 $this->assertSame( $expected, $actual, $message );
68 public function serializeProvider() {
98 'String representation of 1',