<commit_before><?php

namespace Phive\Queue\Tests\Queue;

use Phive\Queue\NoItemAvailableException;
use Phive\Queue\QueueException;
use Phive\Queue\RedisQueue;
use Phive\Queue\Tests\Handler\RedisHandler;

/**
 * @requires function Redis::connect
 */
class RedisQueueTest extends QueueTest
{
    use Performance;
    use Concurrency;

    protected function getUnsupportedItemTypes()
    {
        return [Types::TYPE_ARRAY, Types::TYPE_OBJECT];
    }

    /**
     * @dataProvider provideItemsOfUnsupportedTypes
     * @expectedException PHPUnit_Framework_Exception
     * @expectedExceptionMessageRegExp /could not be converted to s tring|Array to string conversion/
     */
    public function testUnsupportedItemType($item)
    {
        $this->queue->push($item);
    }

    /**
     * @requires function Redis::_serialize
     * @dataProvider provideItemsOfVariousTypes
     */
    public function testSupportItemTypeWithSerializerLoose($item)
    {
        $redis = self::getHandler()->createRedis();<commit_msg>Fix typo<commit_after><?php

namespace Phive\Queue\Tests\Queue;

use Phive\Queue\NoItemAvailableException;
use Phive\Queue\QueueException;
use Phive\Queue\RedisQueue;
use Phive\Queue\Tests\Handler\RedisHandler;

/**
 * @requires function Redis::connect
 */
class RedisQueueTest extends QueueTest
{
    use Performance;
    use Concurrency;

    protected function getUnsupportedItemTypes()
    {
        return [Types::TYPE_ARRAY, Types::TYPE_OBJECT];
    }

    /**
     * @dataProvider provideItemsOfUnsupportedTypes
     * @expectedException PHPUnit_Framework_Exception
     * @expectedExceptionMessageRegExp /could not be converted to string|Array to string conversion/
     */
    public function testUnsupportedItemType($item)
    {
        $this->queue->push($item);
    }

    /**
     * @requires function Redis::_serialize
     * @dataProvider provideItemsOfVariousTypes
     */
    public function testSupportItemTypeWithSerializerLoose($item)
    {
        $redis = self::getHandler()->createRedis();
{'fraction_non_alphanumeric': 0.09950738916256158, 'fraction_numerical': 0.0, 'mean_word_length': 3.734265734265734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5371698', 'n_tokens_mistral': 577, 'n_tokens_neox': 574, 'n_words': 113}