<commit_before><?php

namespace M6Web\Component\RedisMock\tests\units;

use mageekguy\atoum\test;
use M6Web\Component\RedisMock\RedisMock as Redis;

/**
 * Redis mock test
 */
class RedisMock extends test
{
    public function testSetGetDelExists()
    {
        $redisMock = new Redis();

        $this->assert
            ->boolean($redisMock->exists('test'))
                ->isFalse()
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(0)

            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->boolean($redisMock->exists('test'))
                ->isTrue()
            ->string($redisMock->get('test'))
                ->isEqualTo('something')
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->variable($redisMock->get('test'))
                ->isNull()
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->boolean($redisMock->exists('test'))
                ->isFalse()

            ->string($redisMock->setex('test1', 5, 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->type('test1'))
                ->isEqualTo('string')
            ->boolean($redisMock->exists('test1'))
                ->isTrue()
            ->string($redisMock->get('test1'))
                ->isEqualTo('something')
            ->integer($redisMock->del('test1'))
                ->isEqualTo(1)
            ->variable($redisMock->get('test1'))
                ->isNull()
            ->string($redisMock->type('test1'))
                ->isEqualTo('none')
            ->boolean($redisMock->exists('test1'))
                ->isFalse()

            ->string($redisMock->set('test1', 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->set('test2', 'something else'))
                ->isEqualTo('OK')
            ->integer($redisMock->del('test1', 'test2'))
                ->isEqualTo(2)
            ->string($redisMock->set('test1', 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->set('test2', 'something else'))
                ->isEqualTo('OK')
            ->integer($redisMock->del(array('test1', 'test2')))
                ->isEqualTo(2)

            ->string($redisMock->set('test3', 'something', 1))
                ->isEqualTo('OK')
            ->string($redisMock->setex('test4', 2, 'something else'))
                ->isEqualTo('OK')
            ->integer($redisMock->ttl('test3'))
                ->isEqualTo(1)
            ->integer($redisMock->ttl('test4'))
                ->isEqualTo(2)
            ->string($redisMock->get('test3'))
                ->isEqualTo('something')
            ->string($redisMock->get('test4'))
                ->isEqualTo('something else');
        sleep(3);
        $this->assert
            ->variable($redisMock->get('test3'))
                ->isNull()
            ->variable($redisMock->get('test4'))
                ->isNull()

            ->string($redisMock->set('test', 'something', 1))
                ->isEqualTo('OK')
            ->string($redisMock->type('test'))
                ->isEqualTo('string');
        sleep(2);
        $this->assert
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->string($redisMock->set('test', 'something', 1))
                ->isEqualTo('OK')
            ->boolean($redisMock->exists('test'))
                ->isTrue();
        sleep(2);
        $this->assert
            ->boolean($redisMock->exists('test'))
                ->isFalse();

        //setnx
        $this->assert
            ->integer($redisMock->setnx('test-setnx', 'lala'))
                ->isEqualTo(1)
            ->integer($redisMock->setnx('test-setnx', 'lala2'))
                ->isEqualTo(0)
            ->integer($redisMock->del('test-setnx'))
                ->isEqualTo(1)
            ->integer($redisMock->setnx('test-setnx', 'lala'))
                ->isEqualTo(1)
            ->string($redisMock->type('test-setnx'))
            ->isEqualTo('string');

        //setnx with expire
        $this->assert
            ->integer($redisMock->setnx("test-setnx-expire", "lala"))
                ->isEqualTo(1)
            ->integer($redisMock->expire("test-setnx-expire", 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->setnx("test-setnx-expire", "lala"))
                ->isEqualTo(1);

        //mget/mset test (roughly based on hmset/hmset tests)
        $this->assert
            ->array($redisMock->mget(array('raoul', 'test1')))
               ->isEqualTo(array(
                   null,
                   null,
               ))
            ->string($redisMock->mset(array(
                'test1' => 'somthing',
                'raoul' => 'nothing',
            )))
            ->array($redisMock->mget(array('raoul', 'test1')))
                ->isEqualTo(array(
                    'nothing',
                    'somthing',
                ))
            ->integer($redisMock->expire('raoul', 1))
                ->isEqualTo(1)
            ->integer($redisMock->expire('test1', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->array($redisMock->mget(array('raoul', 'test1')))
            ->isEqualTo(array(
                null,
                null,
            ));
    }

    public function testExpireTtl()
    {
        $redisMock = new Redis();

        $this->assert
            ->integer($redisMock->expire('test', 2))
                ->isEqualTo(0)
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(-2)
            ->integer($redisMock->sadd('test', 'one'))
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(-1)
            ->integer($redisMock->expire('test', 2))
                ->isEqualTo(1)
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(2);
        sleep(1);
        $this->assert
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(-2);


        $this->assert
            ->string($redisMock->set('test', 'something', 10))
                ->isEqualTo('OK')
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(10)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1)
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->expire('test', 10))
                ->isEqualTo(0);
    }

    public function testIncr()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->incr('test'))
                ->isEqualTo(1)
            ->integer($redisMock->get('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->incr('test'))
                ->isEqualTo(2)
            ->integer($redisMock->incr('test'))
                ->isEqualTo(3)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->incr('test'))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->incr('test'))
                ->isEqualTo(1)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->incr('test'))
                ->isEqualTo(1);
    }

    public function testIncrby()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->incrby('test', 5))
                ->isEqualTo(5)
            ->integer($redisMock->get('test'))
                ->isEqualTo(5)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->incrby('test', 1))
                ->isEqualTo(6)
            ->integer($redisMock->incrby('test', 2))
                ->isEqualTo(8)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->incrby('test', 4))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->incrby('test', 2))
                ->isEqualTo(2)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->incrby('test', 3))
                ->isEqualTo(3);
    }

    public function testDecr()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-1)
            ->integer($redisMock->get('test'))
                ->isEqualTo(-1)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-2)
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-3)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->decr('test'))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-1)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-1);
    }

    public function testDecrby()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->decrby('test', 5))
                ->isEqualTo(-5)
            ->integer($redisMock->get('test'))
                ->isEqualTo(-5)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->decrby('test', 1))
                ->isEqualTo(-6)
            ->integer($redisMock->decrby('test', 2))
                ->isEqualTo(-8)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->decrby('test', 4))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->decrby('test', 2))
                ->isEqualTo(-2)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->decrby('test', 3))
                ->isEqualTo(-3);
    }

    public function testKeys() {
        $redisMock = new Redis();

        $this->assert
            ->string($redisMock->set('something', 'a'))
                ->isEqualTo('OK')
            ->string($redisMock->set('someting_else', 'b'))
                ->isEqualTo('OK')
            ->string($redisMock->set('others', 'c'))
                ->isEqualTo('OK')
            ->array($redisMock->keys('some'))
                ->isEmpty()
            ->array($redisMock->keys('some*'))
                ->hasSize(2)
                ->containsValues(array('something', 'someting_else'))
            ->array($redisMock->keys('*o*'))
                ->hasSize(3)
                ->containsValues(array('something', 'someting_else', 'others'))
            ->array($redisMock->keys('*[ra]s*'))
                ->hasSize(1)
                ->containsValues(array('others'))
            ->array($redisMock->keys('*[rl]s*'))
                ->hasSize(2)
                ->containsValues(array('someting_else', 'others'))
            ->array($redisMock->keys('somet?ing*'))
                ->hasSize(1)
                ->containsValues(array('something'))
            ->array($redisMock->keys('somet*ing*'))
                ->hasSize(2)
                ->containsValues(array('something', 'someting_else'))
            ->array($redisMock->keys('*'))
                ->hasSize(3)
                ->containsValues(array('something', 'someting_else', 'others'))
            ->integer($redisMock->expire('others', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->array($redisMock->keys('*'))
                ->hasSize(2)
                ->containsValues(array('something', 'someting_else'));
    }
<commit_msg>Add: missing SCARD unit tests<commit_after><?php

namespace M6Web\Component\RedisMock\tests\units;

use mageekguy\atoum\test;
use M6Web\Component\RedisMock\RedisMock as Redis;

/**
 * Redis mock test
 */
class RedisMock extends test
{
    public function testSetGetDelExists()
    {
        $redisMock = new Redis();

        $this->assert
            ->boolean($redisMock->exists('test'))
                ->isFalse()
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(0)

            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->boolean($redisMock->exists('test'))
                ->isTrue()
            ->string($redisMock->get('test'))
                ->isEqualTo('something')
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->variable($redisMock->get('test'))
                ->isNull()
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->boolean($redisMock->exists('test'))
                ->isFalse()

            ->string($redisMock->setex('test1', 5, 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->type('test1'))
                ->isEqualTo('string')
            ->boolean($redisMock->exists('test1'))
                ->isTrue()
            ->string($redisMock->get('test1'))
                ->isEqualTo('something')
            ->integer($redisMock->del('test1'))
                ->isEqualTo(1)
            ->variable($redisMock->get('test1'))
                ->isNull()
            ->string($redisMock->type('test1'))
                ->isEqualTo('none')
            ->boolean($redisMock->exists('test1'))
                ->isFalse()

            ->string($redisMock->set('test1', 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->set('test2', 'something else'))
                ->isEqualTo('OK')
            ->integer($redisMock->del('test1', 'test2'))
                ->isEqualTo(2)
            ->string($redisMock->set('test1', 'something'))
                ->isEqualTo('OK')
            ->string($redisMock->set('test2', 'something else'))
                ->isEqualTo('OK')
            ->integer($redisMock->del(array('test1', 'test2')))
                ->isEqualTo(2)

            ->string($redisMock->set('test3', 'something', 1))
                ->isEqualTo('OK')
            ->string($redisMock->setex('test4', 2, 'something else'))
                ->isEqualTo('OK')
            ->integer($redisMock->ttl('test3'))
                ->isEqualTo(1)
            ->integer($redisMock->ttl('test4'))
                ->isEqualTo(2)
            ->string($redisMock->get('test3'))
                ->isEqualTo('something')
            ->string($redisMock->get('test4'))
                ->isEqualTo('something else');
        sleep(3);
        $this->assert
            ->variable($redisMock->get('test3'))
                ->isNull()
            ->variable($redisMock->get('test4'))
                ->isNull()

            ->string($redisMock->set('test', 'something', 1))
                ->isEqualTo('OK')
            ->string($redisMock->type('test'))
                ->isEqualTo('string');
        sleep(2);
        $this->assert
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->string($redisMock->set('test', 'something', 1))
                ->isEqualTo('OK')
            ->boolean($redisMock->exists('test'))
                ->isTrue();
        sleep(2);
        $this->assert
            ->boolean($redisMock->exists('test'))
                ->isFalse();

        //setnx
        $this->assert
            ->integer($redisMock->setnx('test-setnx', 'lala'))
                ->isEqualTo(1)
            ->integer($redisMock->setnx('test-setnx', 'lala2'))
                ->isEqualTo(0)
            ->integer($redisMock->del('test-setnx'))
                ->isEqualTo(1)
            ->integer($redisMock->setnx('test-setnx', 'lala'))
                ->isEqualTo(1)
            ->string($redisMock->type('test-setnx'))
            ->isEqualTo('string');

        //setnx with expire
        $this->assert
            ->integer($redisMock->setnx("test-setnx-expire", "lala"))
                ->isEqualTo(1)
            ->integer($redisMock->expire("test-setnx-expire", 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->setnx("test-setnx-expire", "lala"))
                ->isEqualTo(1);

        //mget/mset test (roughly based on hmset/hmset tests)
        $this->assert
            ->array($redisMock->mget(array('raoul', 'test1')))
               ->isEqualTo(array(
                   null,
                   null,
               ))
            ->string($redisMock->mset(array(
                'test1' => 'somthing',
                'raoul' => 'nothing',
            )))
            ->array($redisMock->mget(array('raoul', 'test1')))
                ->isEqualTo(array(
                    'nothing',
                    'somthing',
                ))
            ->integer($redisMock->expire('raoul', 1))
                ->isEqualTo(1)
            ->integer($redisMock->expire('test1', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->array($redisMock->mget(array('raoul', 'test1')))
            ->isEqualTo(array(
                null,
                null,
            ));
    }

    public function testExpireTtl()
    {
        $redisMock = new Redis();

        $this->assert
            ->integer($redisMock->expire('test', 2))
                ->isEqualTo(0)
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(-2)
            ->integer($redisMock->sadd('test', 'one'))
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(-1)
            ->integer($redisMock->expire('test', 2))
                ->isEqualTo(1)
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(2);
        sleep(1);
        $this->assert
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(-2);


        $this->assert
            ->string($redisMock->set('test', 'something', 10))
                ->isEqualTo('OK')
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(10)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1)
            ->integer($redisMock->ttl('test'))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->expire('test', 10))
                ->isEqualTo(0);
    }

    public function testIncr()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->incr('test'))
                ->isEqualTo(1)
            ->integer($redisMock->get('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->incr('test'))
                ->isEqualTo(2)
            ->integer($redisMock->incr('test'))
                ->isEqualTo(3)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->incr('test'))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->incr('test'))
                ->isEqualTo(1)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->incr('test'))
                ->isEqualTo(1);
    }

    public function testIncrby()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->incrby('test', 5))
                ->isEqualTo(5)
            ->integer($redisMock->get('test'))
                ->isEqualTo(5)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->incrby('test', 1))
                ->isEqualTo(6)
            ->integer($redisMock->incrby('test', 2))
                ->isEqualTo(8)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->incrby('test', 4))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->incrby('test', 2))
                ->isEqualTo(2)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->incrby('test', 3))
                ->isEqualTo(3);
    }

    public function testDecr()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-1)
            ->integer($redisMock->get('test'))
                ->isEqualTo(-1)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-2)
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-3)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->decr('test'))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-1)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->decr('test'))
                ->isEqualTo(-1);
    }

    public function testDecrby()
    {
        $redisMock = new Redis();

        $this->assert
            ->variable($redisMock->get('test'))
                ->isNull()
            ->integer($redisMock->decrby('test', 5))
                ->isEqualTo(-5)
            ->integer($redisMock->get('test'))
                ->isEqualTo(-5)
            ->string($redisMock->type('test'))
                ->isEqualTo('string')
            ->integer($redisMock->decrby('test', 1))
                ->isEqualTo(-6)
            ->integer($redisMock->decrby('test', 2))
                ->isEqualTo(-8)
            ->string($redisMock->set('test', 'something'))
                ->isEqualTo('OK')
            ->variable($redisMock->decrby('test', 4))
                ->isNull()
            ->integer($redisMock->del('test'))
                ->isEqualTo(1)
            ->string($redisMock->type('test'))
                ->isEqualTo('none')
            ->integer($redisMock->decrby('test', 2))
                ->isEqualTo(-2)
            ->integer($redisMock->expire('test', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->integer($redisMock->decrby('test', 3))
                ->isEqualTo(-3);
    }

    public function testKeys() {
        $redisMock = new Redis();

        $this->assert
            ->string($redisMock->set('something', 'a'))
                ->isEqualTo('OK')
            ->string($redisMock->set('someting_else', 'b'))
                ->isEqualTo('OK')
            ->string($redisMock->set('others', 'c'))
                ->isEqualTo('OK')
            ->array($redisMock->keys('some'))
                ->isEmpty()
            ->array($redisMock->keys('some*'))
                ->hasSize(2)
                ->containsValues(array('something', 'someting_else'))
            ->array($redisMock->keys('*o*'))
                ->hasSize(3)
                ->containsValues(array('something', 'someting_else', 'others'))
            ->array($redisMock->keys('*[ra]s*'))
                ->hasSize(1)
                ->containsValues(array('others'))
            ->array($redisMock->keys('*[rl]s*'))
                ->hasSize(2)
                ->containsValues(array('someting_else', 'others'))
            ->array($redisMock->keys('somet?ing*'))
                ->hasSize(1)
                ->containsValues(array('something'))
            ->array($redisMock->keys('somet*ing*'))
                ->hasSize(2)
                ->containsValues(array('something', 'someting_else'))
            ->array($redisMock->keys('*'))
                ->hasSize(3)
                ->containsValues(array('something', 'someting_else', 'others'))
            ->integer($redisMock->expire('others', 1))
                ->isEqualTo(1);
        sleep(2);
        $this->assert
            ->array($redisMock->keys('*'))
                ->hasSize(2)
                ->containsValues(array('something', 'someting_else'));
    }

    public function testSCard()
    {
        $redisMock = new Redis();
        $redisMock->sadd('test', 'test4');
        $redisMock->sadd('test', 'test2');
        $redisMock->sadd('test', 'test3');
        $redisMock->sadd('test', 'test1');
        $redisMock->sadd('test', 'test5');
        $redisMock->sadd('test', 'test6');

        $this->assert
            ->integer($redisMock->scard('test'))
                ->isEqualTo(6);

        $this->assert
            ->integer($redisMock->scard('nothere'))
                ->isEqualTo(0);
    }

{'fraction_non_alphanumeric': 0.18961001164144353, 'fraction_numerical': 0.010913853317811409, 'mean_word_length': 1.5060625398851308, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 867, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5687261', 'n_tokens_mistral': 8041, 'n_tokens_neox': 7834, 'n_words': 938}