X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fvar-dumper%2FTests%2FCaster%2FExceptionCasterTest.php;fp=vendor%2Fsymfony%2Fvar-dumper%2FTests%2FCaster%2FExceptionCasterTest.php;h=1614f58a9ae9bce0fa2d53a10ecabdd20507281c;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php b/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php new file mode 100644 index 000000000..1614f58a9 --- /dev/null +++ b/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php @@ -0,0 +1,81 @@ + + * + * 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 Symfony\Component\VarDumper\Caster\FrameStub; +use Symfony\Component\VarDumper\Test\VarDumperTestCase; + +class ExceptionCasterTest extends VarDumperTestCase +{ + /** + * @requires function Twig_Template::getSourceContext + */ + public function testFrameWithTwig() + { + require_once dirname(__DIR__).'/Fixtures/Twig.php'; + + $f = array( + new FrameStub(array( + 'file' => dirname(__DIR__).'/Fixtures/Twig.php', + 'line' => 21, + 'class' => '__TwigTemplate_VarDumperFixture_u75a09', + )), + new FrameStub(array( + 'file' => dirname(__DIR__).'/Fixtures/Twig.php', + 'line' => 21, + 'class' => '__TwigTemplate_VarDumperFixture_u75a09', + 'object' => new \__TwigTemplate_VarDumperFixture_u75a09(null, false), + )), + ); + + $expectedDump = <<<'EODUMP' +array:2 [ + 0 => { + class: "__TwigTemplate_VarDumperFixture_u75a09" + src: { + %sTwig.php:21: """ + // line 2\n + throw new \Exception('Foobar');\n + }\n + """ + bar.twig:2: """ + foo bar\n + twig source\n + \n + """ + } + } + 1 => { + class: "__TwigTemplate_VarDumperFixture_u75a09" + object: __TwigTemplate_VarDumperFixture_u75a09 { + %A + } + src: { + %sTwig.php:21: """ + // line 2\n + throw new \Exception('Foobar');\n + }\n + """ + foo.twig:2: """ + foo bar\n + twig source\n + \n + """ + } + } +] + +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $f); + } +}