3 use Wikimedia\TestingAccessWrapper
;
8 class RedisBagOStuffTest
extends PHPUnit\Framework\TestCase
{
10 use MediaWikiCoversValidator
;
12 /** @var RedisBagOStuff */
15 protected function setUp() {
17 $cache = $this->getMockBuilder( RedisBagOStuff
::class )
18 ->disableOriginalConstructor()
20 $this->cache
= TestingAccessWrapper
::newFromObject( $cache );
24 * @covers RedisBagOStuff::unserialize
25 * @dataProvider unserializeProvider
27 public function testUnserialize( $expected, $input, $message ) {
28 $actual = $this->cache
->unserialize( $input );
29 $this->assertSame( $expected, $actual, $message );
32 public function unserializeProvider() {
37 'String representation of \'-1\'',
42 'String representation of \'0\'',
47 'String representation of \'1\'',
52 'Serialized negative double',
63 * @covers RedisBagOStuff::serialize
64 * @dataProvider serializeProvider
66 public function testSerialize( $expected, $input, $message ) {
67 $actual = $this->cache
->serialize( $input );
68 $this->assertSame( $expected, $actual, $message );
71 public function serializeProvider() {
101 'String representation of 1',