* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\VarDumper\Tests\Caster; use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; /** * @author Nicolas Grekas * @requires extension redis */ class RedisCasterTest extends TestCase { use VarDumperTestTrait; public function testNotConnected() { $redis = new \Redis(); if (defined('HHVM_VERSION_ID')) { $xCast = <<<'EODUMP' Redis { #host: "" %A } EODUMP; } else { $xCast = <<<'EODUMP' Redis { isConnected: false } EODUMP; } $this->assertDumpMatchesFormat($xCast, $redis); } public function testConnected() { $redis = new \Redis(); if (!@$redis->connect('127.0.0.1')) { $e = error_get_last(); self::markTestSkipped($e['message']); } if (defined('HHVM_VERSION_ID')) { $xCast = <<<'EODUMP' Redis { #host: "127.0.0.1" %A } EODUMP; } else { $xCast = <<<'EODUMP' Redis {%A isConnected: true host: "127.0.0.1" port: 6379 auth: null dbNum: 0 timeout: 0.0 persistentId: null options: { READ_TIMEOUT: 0.0 SERIALIZER: NONE PREFIX: null SCAN: NORETRY } } EODUMP; } $this->assertDumpMatchesFormat($xCast, $redis); } } __halt_compiler();----SIGNATURE:----Iogjf7hM+qbneno38lTxmwh4Wr+kdhOlmWv0HeDVKuUMEH2cMnRK60xJgJCOgd7k+nFaH4MvhbD3PZAUoRx51T3aa3vlAd0dltOly/MOepUEzMcmn/UorodOc+/iUj+X2qX269onGVgj8YIVMmSvpWlsfg4elh+8Q4eeqZge52olz+ZELj0P9yq4RMk7Lxq6nrxspegZ//85IxGmSnWdZ2Hle3ZtOJhGgIqUq2UQoLfdcVbjks+BURQWmO285ZLcssmn7EgG+bYH/IM1Q9jHQLDtd/YNX1NNjk4lo/AAoB6MqRxBtmerFko78XOa5rx7rU3QNwgwZRx0Gx1glsI2OWa53GYOcPDP30pTIovqShO5w5ssdxWfHVHDWNH7R/LtP9thSfglolUVLgDAYNZQcp6vSKVmOBD0arsNr2LyD4TE19mzmWQykipmTB5WEmCZUi7/fbw0C8lL6wdImtSWwknjgWi2GrP1ha6SocDphzOeT07/EyarTYuMLNwhySMMXf863atla+cMZtbR75Pk0BL+Lc1jbdKjQERcTSYG1NeEB+1pL+7OAmwjXsEkUWKkWY4eFTfjiFXVDDN9crU/DtLpSlNw7uu4cAo4UxxQAYzxi9aBtjwqMpDRpJwVARKojL9um5QNzN5EhNGRRWODRHTQHYV6ZMMbCAAIsoTQzPk=----ATTACHMENT:----NzQ4MDkwNjQ4ODUyOTc5MiA5MDQ1MzM0OTM5Njk4NTQ2IDQ5OTA4NTUxNjE0NTg5NzI=