13
13
14
14
use Symfony \Bridge \Twig \Extension \DumpExtension ;
15
15
use Symfony \Component \VarDumper \VarDumper ;
16
- use Symfony \Component \VarDumper \Cloner \PhpCloner ;
16
+ use Symfony \Component \VarDumper \Cloner \VarCloner ;
17
17
18
18
class DumpExtensionTest extends \PHPUnit_Framework_TestCase
19
19
{
@@ -22,7 +22,7 @@ class DumpExtensionTest extends \PHPUnit_Framework_TestCase
22
22
*/
23
23
public function testDumpTag ($ template , $ debug , $ expectedOutput , $ expectedDumped )
24
24
{
25
- $ extension = new DumpExtension (new PhpCloner ());
25
+ $ extension = new DumpExtension (new VarCloner ());
26
26
$ twig = new \Twig_Environment (new \Twig_Loader_String (), array (
27
27
'debug ' => $ debug ,
28
28
'cache ' => false ,
@@ -62,7 +62,7 @@ public function getDumpTags()
62
62
*/
63
63
public function testDump ($ context , $ args , $ expectedOutput , $ debug = true )
64
64
{
65
- $ extension = new DumpExtension (new PhpCloner ());
65
+ $ extension = new DumpExtension (new VarCloner ());
66
66
$ twig = new \Twig_Environment (new \Twig_Loader_String (), array (
67
67
'debug ' => $ debug ,
68
68
'cache ' => false ,
@@ -77,7 +77,7 @@ public function testDump($context, $args, $expectedOutput, $debug = true)
77
77
if ($ debug ) {
78
78
$ this ->assertStringStartsWith ('<script> ' , $ dump );
79
79
$ dump = preg_replace ('/^.*?<pre/ ' , '<pre ' , $ dump );
80
- $ dump = preg_replace ('/sf-dump- \\ d{2,} / ' , 'sf-dump ' , $ dump );
80
+ $ dump = preg_replace ('/sf-dump-\d+ / ' , 'sf-dump ' , $ dump );
81
81
}
82
82
$ this ->assertEquals ($ expectedOutput , $ dump );
83
83
}
@@ -86,20 +86,20 @@ public function getDumpArgs()
86
86
{
87
87
return array (
88
88
array (array (), array (), '' , false ),
89
- array (array (), array (), "<pre class=sf-dump>[] \n</pre><script>Sfjs.dump .instrument()</script> \n" ),
89
+ array (array (), array (), "<pre class=sf-dump>[] \n</pre><script>Sfdump .instrument()</script> \n" ),
90
90
array (
91
91
array (),
92
92
array (123 , 456 ),
93
- "<pre class=sf-dump><span class=sf-dump-num>123</span> \n</pre><script>Sfjs.dump .instrument()</script> \n"
94
- ."<pre class=sf-dump><span class=sf-dump-num>456</span> \n</pre><script>Sfjs.dump .instrument()</script> \n" ,
93
+ "<pre class=sf-dump><span class=sf-dump-num>123</span> \n</pre><script>Sfdump .instrument()</script> \n"
94
+ ."<pre class=sf-dump><span class=sf-dump-num>456</span> \n</pre><script>Sfdump .instrument()</script> \n" ,
95
95
),
96
96
array (
97
97
array ('foo ' => 'bar ' ),
98
98
array (),
99
99
"<pre class=sf-dump><span class=sf-dump-note>array:1</span> [<span name=sf-dump-child> \n"
100
100
." \"<span class=sf-dump-meta>foo</span> \" => \"<span class=sf-dump-str>bar</span> \"\n"
101
101
."</span>] \n"
102
- ."</pre><script>Sfjs.dump .instrument()</script> \n" ,
102
+ ."</pre><script>Sfdump .instrument()</script> \n" ,
103
103
),
104
104
);
105
105
}
0 commit comments