update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -210,8 +210,8 @@ array:2 [
|
||||
executing: {
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo(): {
|
||||
%sGeneratorDemo.php:10: """
|
||||
yield 1;\n
|
||||
}\n
|
||||
yield 1;\n
|
||||
}\n
|
||||
\n
|
||||
"""
|
||||
}
|
||||
|
@@ -128,6 +128,45 @@ EOTXT
|
||||
);
|
||||
}
|
||||
|
||||
public function testJsonCast()
|
||||
{
|
||||
$var = (array) json_decode('{"0":{},"1":null}');
|
||||
foreach ($var as &$v) {
|
||||
}
|
||||
$var[] = &$v;
|
||||
$var[''] = 2;
|
||||
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<EOTXT
|
||||
array:4 [
|
||||
"0" => {}
|
||||
"1" => &1 null
|
||||
0 => &1 null
|
||||
"" => 2
|
||||
]
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
}
|
||||
|
||||
public function testObjectCast()
|
||||
{
|
||||
$var = (object) array(1 => 1);
|
||||
$var->{1} = 2;
|
||||
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<EOTXT
|
||||
{
|
||||
+1: 1
|
||||
+"1": 2
|
||||
}
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
}
|
||||
|
||||
public function testClosedResource()
|
||||
{
|
||||
if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
||||
@@ -195,7 +234,7 @@ EOTXT
|
||||
$twig = <<<EOTXT
|
||||
foo.twig:2: """
|
||||
foo bar\\n
|
||||
twig source\\n
|
||||
twig source\\n
|
||||
\\n
|
||||
"""
|
||||
|
||||
|
@@ -29,6 +29,6 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig_Template
|
||||
return array (19 => 2);
|
||||
}
|
||||
}
|
||||
/* foo bar*/
|
||||
/* foo bar*/
|
||||
/* twig source*/
|
||||
/* */
|
||||
|
@@ -135,6 +135,72 @@ EOTXT;
|
||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||
}
|
||||
|
||||
public function testJsonCast()
|
||||
{
|
||||
$data = (array) json_decode('{"1":{}}');
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$clone = $cloner->cloneVar($data);
|
||||
|
||||
$expected = <<<'EOTXT'
|
||||
object(Symfony\Component\VarDumper\Cloner\Data)#%i (4) {
|
||||
["data":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (7) {
|
||||
["type"]=>
|
||||
string(5) "array"
|
||||
["class"]=>
|
||||
string(5) "assoc"
|
||||
["value"]=>
|
||||
int(1)
|
||||
["cut"]=>
|
||||
int(0)
|
||||
["handle"]=>
|
||||
int(0)
|
||||
["refCount"]=>
|
||||
int(0)
|
||||
["position"]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
["1"]=>
|
||||
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (7) {
|
||||
["type"]=>
|
||||
string(6) "object"
|
||||
["class"]=>
|
||||
string(8) "stdClass"
|
||||
["value"]=>
|
||||
NULL
|
||||
["cut"]=>
|
||||
int(0)
|
||||
["handle"]=>
|
||||
int(%i)
|
||||
["refCount"]=>
|
||||
int(0)
|
||||
["position"]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
["maxDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||
int(20)
|
||||
["maxItemsPerDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||
int(-1)
|
||||
["useRefHandles":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||
int(-1)
|
||||
}
|
||||
|
||||
EOTXT;
|
||||
ob_start();
|
||||
var_dump($clone);
|
||||
$this->assertStringMatchesFormat($expected, ob_get_clean());
|
||||
}
|
||||
|
||||
public function testCaster()
|
||||
{
|
||||
$cloner = new VarCloner(array(
|
||||
|
Reference in New Issue
Block a user