Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * This file is part of PhpRedisJSON library * * @project phpredis-json * @..

Decoded Output download

<?php
/**
 * This file is part of PhpRedisJSON library
 *
 * @project   phpredis-json
 * @author    Rafael Campoy <[email protected]>
 * @copyright 2019 Rafael Campoy <[email protected]>
 * @license   MIT
 * @link      https://github.com/averias/phpredis-json
 *
 * Copyright and license information, is included in
 * the LICENSE file that is distributed with this source code.
 */

namespace Averias\RedisJson\Tests\Unit\Factory;

use Averias\RedisJson\Client\RedisJsonClientInterface;
use Averias\RedisJson\Exception\RedisClientException;
use Averias\RedisJson\Factory\RedisJsonClientFactory;
use Averias\RedisJson\Enum\Connection;
use PHPUnit\Framework\TestCase;

class RedisJsonClientFactoryTest extends TestCase
{
    public function testCreateClientException()
    {
        $this->expectException(RedisClientException::class);
        $factory = new RedisJsonClientFactory();
        $factory->createClient([
            'database' => 62
        ]);
    }

    public function testCreateClient()
    {
        $factory = new RedisJsonClientFactory();
        $client = $factory->createClient([
            Connection::HOST => REDIS_TEST_SERVER,
            Connection::PORT => (int) REDIS_TEST_PORT,
            Connection::TIMEOUT => 2
        ]);

        $this->assertInstanceOf(RedisJsonClientInterface::class, $client);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
/**
 * This file is part of PhpRedisJSON library
 *
 * @project   phpredis-json
 * @author    Rafael Campoy <[email protected]>
 * @copyright 2019 Rafael Campoy <[email protected]>
 * @license   MIT
 * @link      https://github.com/averias/phpredis-json
 *
 * Copyright and license information, is included in
 * the LICENSE file that is distributed with this source code.
 */

namespace Averias\RedisJson\Tests\Unit\Factory;

use Averias\RedisJson\Client\RedisJsonClientInterface;
use Averias\RedisJson\Exception\RedisClientException;
use Averias\RedisJson\Factory\RedisJsonClientFactory;
use Averias\RedisJson\Enum\Connection;
use PHPUnit\Framework\TestCase;

class RedisJsonClientFactoryTest extends TestCase
{
    public function testCreateClientException()
    {
        $this->expectException(RedisClientException::class);
        $factory = new RedisJsonClientFactory();
        $factory->createClient([
            'database' => 62
        ]);
    }

    public function testCreateClient()
    {
        $factory = new RedisJsonClientFactory();
        $client = $factory->createClient([
            Connection::HOST => REDIS_TEST_SERVER,
            Connection::PORT => (int) REDIS_TEST_PORT,
            Connection::TIMEOUT => 2
        ]);

        $this->assertInstanceOf(RedisJsonClientInterface::class, $client);
    }
}

Function Calls

None

Variables

None

Stats

MD5 e6c30ecea651a255d05a0282f0f957b9
Eval Count 0
Decode Time 114 ms