3 use Wikimedia\TestingAccessWrapper
;
8 class RedisBagOStuffTest
extends MediaWikiUnitTestCase
{
10 /** @var RedisBagOStuff */
13 protected function setUp() {
15 $cache = $this->getMockBuilder( RedisBagOStuff
::class )
16 ->disableOriginalConstructor()
18 $this->cache
= TestingAccessWrapper
::newFromObject( $cache );
22 * @covers RedisBagOStuff::unserialize
23 * @dataProvider unserializeProvider
25 public function testUnserialize( $expected, $input, $message ) {
26 $actual = $this->cache
->unserialize( $input );
27 $this->assertSame( $expected, $actual, $message );
30 public function unserializeProvider() {
35 'String representation of \'-1\'',
40 'String representation of \'0\'',
45 'String representation of \'1\'',
50 'Serialized negative double',
61 * @covers RedisBagOStuff::serialize
62 * @dataProvider serializeProvider
64 public function testSerialize( $expected, $input, $message ) {
65 $actual = $this->cache
->serialize( $input );
66 $this->assertSame( $expected, $actual, $message );
69 public function serializeProvider() {
99 'String representation of 1',