update2
This commit is contained in:
parent
98419bd18d
commit
8a69e45efa
4919 changed files with 28311 additions and 224136 deletions
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php
vendored
Executable file → Normal file
109
pfosten/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php
vendored
Executable file → Normal file
109
pfosten/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php
vendored
Executable file → Normal file
|
|
@ -12,6 +12,7 @@
|
|||
namespace Symfony\Component\VarDumper\Tests\Caster;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Caster\Caster;
|
||||
use Symfony\Component\VarDumper\Caster\ExceptionCaster;
|
||||
use Symfony\Component\VarDumper\Caster\FrameStub;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
|
|
@ -43,22 +44,15 @@ Exception {
|
|||
#message: "foo"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 27
|
||||
#line: 28
|
||||
trace: {
|
||||
%sExceptionCasterTest.php:27: {
|
||||
: {
|
||||
: return new \Exception(''.$msg);
|
||||
: }
|
||||
}
|
||||
%sExceptionCasterTest.php:%d: {
|
||||
: $ref = array('foo');
|
||||
: $e = $this->getTestException('foo', $ref);
|
||||
:
|
||||
arguments: {
|
||||
$msg: "foo"
|
||||
&$ref: array:1 [ …1]
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:28 {
|
||||
› {
|
||||
› return new \Exception(''.$msg);
|
||||
› }
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:40 { …}
|
||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testDefaultSettings() {}
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -72,19 +66,13 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
{
|
||||
%sExceptionCasterTest.php:27: {
|
||||
: {
|
||||
: return new \Exception(''.$msg);
|
||||
: }
|
||||
}
|
||||
%sExceptionCasterTest.php:%d: {
|
||||
: {
|
||||
: $e = $this->getTestException(2);
|
||||
:
|
||||
arguments: {
|
||||
$msg: 2
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:28 {
|
||||
› {
|
||||
› return new \Exception(''.$msg);
|
||||
› }
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:65 { …}
|
||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testSeek() {}
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -101,18 +89,15 @@ Exception {
|
|||
#message: "1"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 27
|
||||
#line: 28
|
||||
trace: {
|
||||
%sExceptionCasterTest.php:27: {
|
||||
: {
|
||||
: return new \Exception(''.$msg);
|
||||
: }
|
||||
}
|
||||
%sExceptionCasterTest.php:%d: {
|
||||
: {
|
||||
: $e = $this->getTestException(1);
|
||||
: ExceptionCaster::$traceArgs = false;
|
||||
%sExceptionCasterTest.php:28 {
|
||||
› {
|
||||
› return new \Exception(''.$msg);
|
||||
› }
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:84 { …}
|
||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testNoArgs() {}
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -129,10 +114,10 @@ Exception {
|
|||
#message: "1"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 27
|
||||
#line: 28
|
||||
trace: {
|
||||
%sExceptionCasterTest.php: 27
|
||||
%sExceptionCasterTest.php: %d
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:28
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:%d
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -141,6 +126,10 @@ EODUMP;
|
|||
|
||||
public function testHtmlDump()
|
||||
{
|
||||
if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
|
||||
$this->markTestSkipped('A custom file_link_format is defined.');
|
||||
}
|
||||
|
||||
$e = $this->getTestException(1);
|
||||
ExceptionCaster::$srcContext = -1;
|
||||
|
||||
|
|
@ -157,10 +146,10 @@ EODUMP;
|
|||
#<span class=sf-dump-protected title="Protected property">code</span>: <span class=sf-dump-num>0</span>
|
||||
#<span class=sf-dump-protected title="Protected property">file</span>: "<span class=sf-dump-str title="%sExceptionCasterTest.php
|
||||
%d characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>"
|
||||
#<span class=sf-dump-protected title="Protected property">line</span>: <span class=sf-dump-num>27</span>
|
||||
#<span class=sf-dump-protected title="Protected property">line</span>: <span class=sf-dump-num>28</span>
|
||||
<span class=sf-dump-meta>trace</span>: {<samp>
|
||||
<span class=sf-dump-meta title="%sExceptionCasterTest.php
|
||||
Stack level %d."><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>: <span class=sf-dump-num>27</span>
|
||||
Stack level %d."><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>:<span class=sf-dump-num>28</span>
|
||||
…%d
|
||||
</samp>}
|
||||
</samp>}
|
||||
|
|
@ -175,16 +164,16 @@ EODUMP;
|
|||
*/
|
||||
public function testFrameWithTwig()
|
||||
{
|
||||
require_once dirname(__DIR__).'/Fixtures/Twig.php';
|
||||
require_once \dirname(__DIR__).'/Fixtures/Twig.php';
|
||||
|
||||
$f = array(
|
||||
new FrameStub(array(
|
||||
'file' => dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'file' => \dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'line' => 20,
|
||||
'class' => '__TwigTemplate_VarDumperFixture_u75a09',
|
||||
)),
|
||||
new FrameStub(array(
|
||||
'file' => dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'file' => \dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'line' => 21,
|
||||
'class' => '__TwigTemplate_VarDumperFixture_u75a09',
|
||||
'object' => new \__TwigTemplate_VarDumperFixture_u75a09(null, __FILE__),
|
||||
|
|
@ -196,10 +185,10 @@ array:2 [
|
|||
0 => {
|
||||
class: "__TwigTemplate_VarDumperFixture_u75a09"
|
||||
src: {
|
||||
%sTwig.php:1: {
|
||||
:
|
||||
: foo bar
|
||||
: twig source
|
||||
%sTwig.php:1 {
|
||||
›
|
||||
› foo bar
|
||||
› twig source
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -209,10 +198,10 @@ array:2 [
|
|||
%A
|
||||
}
|
||||
src: {
|
||||
%sExceptionCasterTest.php:2: {
|
||||
: foo bar
|
||||
: twig source
|
||||
:
|
||||
%sExceptionCasterTest.php:2 {
|
||||
› foo bar
|
||||
› twig source
|
||||
›
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -222,4 +211,20 @@ EODUMP;
|
|||
|
||||
$this->assertDumpMatchesFormat($expectedDump, $f);
|
||||
}
|
||||
|
||||
public function testExcludeVerbosity()
|
||||
{
|
||||
$e = $this->getTestException('foo');
|
||||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
Exception {
|
||||
#message: "foo"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 28
|
||||
}
|
||||
EODUMP;
|
||||
|
||||
$this->assertDumpMatchesFormat($expectedDump, $e, Caster::EXCLUDE_VERBOSE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php
vendored
Executable file → Normal file
7
pfosten/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php
vendored
Executable file → Normal file
7
pfosten/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php
vendored
Executable file → Normal file
|
|
@ -26,7 +26,7 @@ class RedisCasterTest extends TestCase
|
|||
{
|
||||
$redis = new \Redis();
|
||||
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
if (\defined('HHVM_VERSION_ID')) {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
#host: ""
|
||||
|
|
@ -52,7 +52,7 @@ EODUMP;
|
|||
self::markTestSkipped($e['message']);
|
||||
}
|
||||
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
if (\defined('HHVM_VERSION_ID')) {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
#host: "127.0.0.1"
|
||||
|
|
@ -61,8 +61,7 @@ Redis {
|
|||
EODUMP;
|
||||
} else {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
+"socket": Redis Socket Buffer resource
|
||||
Redis {%A
|
||||
isConnected: true
|
||||
host: "127.0.0.1"
|
||||
port: 6379
|
||||
|
|
|
|||
59
pfosten/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php
vendored
Executable file → Normal file
59
pfosten/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php
vendored
Executable file → Normal file
|
|
@ -12,6 +12,7 @@
|
|||
namespace Symfony\Component\VarDumper\Tests\Caster;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Caster\Caster;
|
||||
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
|
||||
use Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo;
|
||||
use Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass;
|
||||
|
|
@ -77,13 +78,27 @@ Closure {
|
|||
\$b: & 123
|
||||
}
|
||||
file: "%sReflectionCasterTest.php"
|
||||
line: "67 to 67"
|
||||
line: "68 to 68"
|
||||
}
|
||||
EOTXT
|
||||
, $var
|
||||
);
|
||||
}
|
||||
|
||||
public function testClosureCasterExcludingVerbosity()
|
||||
{
|
||||
$var = function () {};
|
||||
|
||||
$expectedDump = <<<EOTXT
|
||||
Closure {
|
||||
class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest"
|
||||
this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { …}
|
||||
}
|
||||
EOTXT;
|
||||
|
||||
$this->assertDumpEquals($expectedDump, $var, Caster::EXCLUDE_VERBOSE);
|
||||
}
|
||||
|
||||
public function testReflectionParameter()
|
||||
{
|
||||
$var = new \ReflectionParameter(__NAMESPACE__.'\reflectionParameterFixture', 0);
|
||||
|
|
@ -148,7 +163,7 @@ EOTXT
|
|||
*/
|
||||
public function testGenerator()
|
||||
{
|
||||
if (extension_loaded('xdebug')) {
|
||||
if (\extension_loaded('xdebug')) {
|
||||
$this->markTestSkipped('xdebug is active');
|
||||
}
|
||||
|
||||
|
|
@ -159,11 +174,11 @@ EOTXT
|
|||
Generator {
|
||||
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
|
||||
executing: {
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz(): {
|
||||
%sGeneratorDemo.php:14: {
|
||||
: {
|
||||
: yield from bar();
|
||||
: }
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz() {
|
||||
%sGeneratorDemo.php:14 {
|
||||
› {
|
||||
› yield from bar();
|
||||
› }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -182,31 +197,23 @@ array:2 [
|
|||
0 => ReflectionGenerator {
|
||||
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
|
||||
trace: {
|
||||
%sGeneratorDemo.php:9: {
|
||||
: {
|
||||
: yield 1;
|
||||
: }
|
||||
}
|
||||
%sGeneratorDemo.php:20: {
|
||||
: {
|
||||
: yield from GeneratorDemo::foo();
|
||||
: }
|
||||
}
|
||||
%sGeneratorDemo.php:14: {
|
||||
: {
|
||||
: yield from bar();
|
||||
: }
|
||||
%s%eTests%eFixtures%eGeneratorDemo.php:9 {
|
||||
› {
|
||||
› yield 1;
|
||||
› }
|
||||
}
|
||||
%s%eTests%eFixtures%eGeneratorDemo.php:20 { …}
|
||||
%s%eTests%eFixtures%eGeneratorDemo.php:14 { …}
|
||||
}
|
||||
closed: false
|
||||
}
|
||||
1 => Generator {
|
||||
executing: {
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo(): {
|
||||
%sGeneratorDemo.php:10: {
|
||||
: yield 1;
|
||||
: }
|
||||
:
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo() {
|
||||
%sGeneratorDemo.php:10 {
|
||||
› yield 1;
|
||||
› }
|
||||
›
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
66
pfosten/vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php
vendored
Executable file → Normal file
66
pfosten/vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php
vendored
Executable file → Normal file
|
|
@ -144,4 +144,70 @@ EOTXT;
|
|||
array(\SplDoublyLinkedList::IT_MODE_LIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_LIFO | IT_MODE_DELETE'),
|
||||
);
|
||||
}
|
||||
|
||||
public function testCastObjectStorageIsntModified()
|
||||
{
|
||||
$var = new \SplObjectStorage();
|
||||
$var->attach(new \stdClass());
|
||||
$var->rewind();
|
||||
$current = $var->current();
|
||||
|
||||
$this->assertDumpMatchesFormat('%A', $var);
|
||||
$this->assertSame($current, $var->current());
|
||||
}
|
||||
|
||||
public function testCastObjectStorageDumpsInfo()
|
||||
{
|
||||
$var = new \SplObjectStorage();
|
||||
$var->attach(new \stdClass(), new \DateTime());
|
||||
|
||||
$this->assertDumpMatchesFormat('%ADateTime%A', $var);
|
||||
}
|
||||
|
||||
public function testCastArrayObject()
|
||||
{
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
$this->markTestSkipped('HHVM as different internal details.');
|
||||
}
|
||||
$var = new \ArrayObject(array(123));
|
||||
$var->foo = 234;
|
||||
|
||||
$expected = <<<EOTXT
|
||||
ArrayObject {
|
||||
+"foo": 234
|
||||
flag::STD_PROP_LIST: false
|
||||
flag::ARRAY_AS_PROPS: false
|
||||
iteratorClass: "ArrayIterator"
|
||||
storage: array:1 [
|
||||
0 => 123
|
||||
]
|
||||
}
|
||||
EOTXT;
|
||||
$this->assertDumpEquals($expected, $var);
|
||||
}
|
||||
|
||||
public function testArrayIterator()
|
||||
{
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
$this->markTestSkipped('HHVM as different internal details.');
|
||||
}
|
||||
$var = new MyArrayIterator(array(234));
|
||||
|
||||
$expected = <<<EOTXT
|
||||
Symfony\Component\VarDumper\Tests\Caster\MyArrayIterator {
|
||||
-foo: 123
|
||||
flag::STD_PROP_LIST: false
|
||||
flag::ARRAY_AS_PROPS: false
|
||||
storage: array:1 [
|
||||
0 => 234
|
||||
]
|
||||
}
|
||||
EOTXT;
|
||||
$this->assertDumpEquals($expected, $var);
|
||||
}
|
||||
}
|
||||
|
||||
class MyArrayIterator extends \ArrayIterator
|
||||
{
|
||||
private $foo = 123;
|
||||
}
|
||||
|
|
|
|||
27
pfosten/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php
vendored
Executable file → Normal file
27
pfosten/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php
vendored
Executable file → Normal file
|
|
@ -100,7 +100,28 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sStubCasterTest.php:0" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="55 characters">Symfony\Component\VarDumper\Tests\Caster\StubCasterTest</span></a>"
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sStubCasterTest.php:0" rel="noopener noreferrer"><span class=sf-dump-str title="55 characters">Symfony\Component\VarDumper\Tests\Caster\StubCasterTest</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
||||
$this->assertStringMatchesFormat($expectedDump, $dump);
|
||||
}
|
||||
|
||||
public function testLinkStubWithNoFileLink()
|
||||
{
|
||||
$var = array(new LinkStub('example.com', 0, 'http://example.com'));
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$dumper = new HtmlDumper();
|
||||
$dumper->setDumpHeader('<foo></foo>');
|
||||
$dumper->setDumpBoundaries('<bar>', '</bar>');
|
||||
$dumper->setDisplayOptions(array('fileLinkFormat' => '%f:%l'));
|
||||
$dump = $dumper->dump($cloner->cloneVar($var), true);
|
||||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="http://example.com" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="11 characters">example.com</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
|
@ -120,7 +141,7 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:10" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:10" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
|
@ -161,7 +182,7 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:5" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:5" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Tests/Cloner/DataTest.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Tests/Cloner/DataTest.php
vendored
Executable file → Normal file
|
|
@ -26,14 +26,14 @@ class DataTest extends TestCase
|
|||
$clonedValues = array();
|
||||
|
||||
$this->assertInstanceOf(Data::class, $data);
|
||||
$this->assertCount(count($values), $data);
|
||||
$this->assertCount(\count($values), $data);
|
||||
$this->assertFalse(isset($data->{0}));
|
||||
$this->assertFalse(isset($data[0]));
|
||||
|
||||
foreach ($data as $k => $v) {
|
||||
$this->assertTrue(isset($data->{$k}));
|
||||
$this->assertTrue(isset($data[$k]));
|
||||
$this->assertSame(gettype($values[$k]), $data->seek($k)->getType());
|
||||
$this->assertSame(\gettype($values[$k]), $data->seek($k)->getType());
|
||||
$this->assertSame($values[$k], $data->seek($k)->getValue());
|
||||
$this->assertSame($values[$k], $data->{$k});
|
||||
$this->assertSame($values[$k], $data[$k]);
|
||||
|
|
|
|||
215
pfosten/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php
vendored
Executable file → Normal file
215
pfosten/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php
vendored
Executable file → Normal file
|
|
@ -33,19 +33,9 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
[0] => Array
|
||||
(
|
||||
[type] => array
|
||||
[class] => assoc
|
||||
[value] => 1
|
||||
[cut] => 0
|
||||
[handle] => 0
|
||||
[refCount] => 0
|
||||
[position] => 1
|
||||
[attr] => Array
|
||||
(
|
||||
)
|
||||
|
||||
[1] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
|
@ -84,7 +74,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => stdClass
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
@ -103,7 +93,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[\000+\0001] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => stdClass
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
@ -118,7 +108,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
|
||||
[\000+\0002] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => stdClass
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
@ -152,13 +142,181 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
[useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
)
|
||||
|
||||
EOTXT;
|
||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||
}
|
||||
|
||||
public function testLimits()
|
||||
{
|
||||
// Level 0:
|
||||
$data = array(
|
||||
// Level 1:
|
||||
array(
|
||||
// Level 2:
|
||||
array(
|
||||
// Level 3:
|
||||
'Level 3 Item 0',
|
||||
'Level 3 Item 1',
|
||||
'Level 3 Item 2',
|
||||
'Level 3 Item 3',
|
||||
),
|
||||
array(
|
||||
'Level 3 Item 4',
|
||||
'Level 3 Item 5',
|
||||
'Level 3 Item 6',
|
||||
),
|
||||
array(
|
||||
'Level 3 Item 7',
|
||||
),
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'Level 3 Item 8',
|
||||
),
|
||||
'Level 2 Item 0',
|
||||
),
|
||||
array(
|
||||
'Level 2 Item 1',
|
||||
),
|
||||
'Level 1 Item 0',
|
||||
array(
|
||||
// Test setMaxString:
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
'SHORT',
|
||||
),
|
||||
);
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$cloner->setMinDepth(2);
|
||||
$cloner->setMaxItems(5);
|
||||
$cloner->setMaxString(20);
|
||||
$clone = $cloner->cloneVar($data);
|
||||
|
||||
$expected = <<<EOTXT
|
||||
Symfony\Component\VarDumper\Cloner\Data Object
|
||||
(
|
||||
[data:Symfony\Component\VarDumper\Cloner\Data:private] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[2] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[2] => 2
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[2] => 3
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[2] => 4
|
||||
)
|
||||
|
||||
[3] => Level 1 Item 0
|
||||
[4] => Array
|
||||
(
|
||||
[2] => 5
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[2] => 6
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => 2
|
||||
[2] => 7
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => 1
|
||||
[2] => 0
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[3] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => 1
|
||||
[2] => 0
|
||||
)
|
||||
|
||||
[1] => Level 2 Item 0
|
||||
)
|
||||
|
||||
[4] => Array
|
||||
(
|
||||
[0] => Level 2 Item 1
|
||||
)
|
||||
|
||||
[5] => Array
|
||||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => 2
|
||||
[class] => 2
|
||||
[value] => ABCDEFGHIJKLMNOPQRST
|
||||
[cut] => 6
|
||||
[handle] => 0
|
||||
[refCount] => 0
|
||||
[position] => 0
|
||||
[attr] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => SHORT
|
||||
)
|
||||
|
||||
[6] => Array
|
||||
(
|
||||
[0] => Level 3 Item 0
|
||||
[1] => Level 3 Item 1
|
||||
[2] => Level 3 Item 2
|
||||
[3] => Level 3 Item 3
|
||||
)
|
||||
|
||||
[7] => Array
|
||||
(
|
||||
[0] => Level 3 Item 4
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[position:Symfony\Component\VarDumper\Cloner\Data:private] => 0
|
||||
[key:Symfony\Component\VarDumper\Cloner\Data:private] => 0
|
||||
[maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20
|
||||
[maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
[useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
)
|
||||
|
||||
EOTXT;
|
||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||
}
|
||||
|
||||
public function testJsonCast()
|
||||
{
|
||||
if (ini_get('xdebug.overload_var_dump') == 2) {
|
||||
if (2 == ini_get('xdebug.overload_var_dump')) {
|
||||
$this->markTestSkipped('xdebug is active');
|
||||
}
|
||||
|
||||
|
|
@ -174,24 +332,9 @@ object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) {
|
|||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (8) {
|
||||
["type"]=>
|
||||
string(5) "array"
|
||||
["class"]=>
|
||||
string(5) "assoc"
|
||||
["value"]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["cut"]=>
|
||||
int(0)
|
||||
["handle"]=>
|
||||
int(0)
|
||||
["refCount"]=>
|
||||
int(0)
|
||||
["position"]=>
|
||||
int(1)
|
||||
["attr"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
[1]=>
|
||||
|
|
@ -199,7 +342,7 @@ object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) {
|
|||
["1"]=>
|
||||
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (8) {
|
||||
["type"]=>
|
||||
string(6) "object"
|
||||
int(4)
|
||||
["class"]=>
|
||||
string(8) "stdClass"
|
||||
["value"]=>
|
||||
|
|
@ -233,7 +376,7 @@ object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) {
|
|||
EOTXT;
|
||||
ob_start();
|
||||
var_dump($clone);
|
||||
$this->assertStringMatchesFormat($expected, ob_get_clean());
|
||||
$this->assertStringMatchesFormat(\PHP_VERSION_ID >= 70200 ? str_replace('"1"', '1', $expected) : $expected, ob_get_clean());
|
||||
}
|
||||
|
||||
public function testCaster()
|
||||
|
|
@ -259,7 +402,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => %s
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
|
|||
119
pfosten/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php
vendored
Executable file → Normal file
119
pfosten/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php
vendored
Executable file → Normal file
|
|
@ -48,7 +48,7 @@ class CliDumperTest extends TestCase
|
|||
$intMax = PHP_INT_MAX;
|
||||
$res = (int) $var['res'];
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
array:24 [
|
||||
|
|
@ -86,7 +86,7 @@ array:24 [
|
|||
default: null
|
||||
}
|
||||
}
|
||||
file: "{$var['file']}"
|
||||
file: "%s%eTests%eFixtures%edumb-var.php"
|
||||
line: "{$var['line']} to {$var['line']}"
|
||||
}
|
||||
"line" => {$var['line']}
|
||||
|
|
@ -130,6 +130,36 @@ EOTXT
|
|||
$this->assertSame($expected, $dump);
|
||||
}
|
||||
|
||||
public function testDumpWithCommaFlagsAndExceptionCodeExcerpt()
|
||||
{
|
||||
$dumper = new CliDumper(null, null, CliDumper::DUMP_TRAILING_COMMA);
|
||||
$dumper->setColors(false);
|
||||
$cloner = new VarCloner();
|
||||
|
||||
$ex = new \RuntimeException('foo');
|
||||
|
||||
$dump = $dumper->dump($cloner->cloneVar($ex)->withRefHandles(false), true);
|
||||
|
||||
$this->assertStringMatchesFormat(<<<'EOTXT'
|
||||
RuntimeException {
|
||||
#message: "foo"
|
||||
#code: 0
|
||||
#file: "%ACliDumperTest.php"
|
||||
#line: %d
|
||||
trace: {
|
||||
%ACliDumperTest.php:%d {
|
||||
›
|
||||
› $ex = new \RuntimeException('foo');
|
||||
›
|
||||
}
|
||||
%A
|
||||
}
|
||||
}
|
||||
|
||||
EOTXT
|
||||
, $dump);
|
||||
}
|
||||
|
||||
public function provideDumpWithCommaFlagTests()
|
||||
{
|
||||
$expected = <<<'EOTXT'
|
||||
|
|
@ -200,8 +230,22 @@ EOTXT
|
|||
$var[] = &$v;
|
||||
$var[''] = 2;
|
||||
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
if (\PHP_VERSION_ID >= 70200) {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
array:4 [
|
||||
0 => {}
|
||||
1 => &1 null
|
||||
2 => &1 null
|
||||
"" => 2
|
||||
]
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
} else {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
array:4 [
|
||||
"0" => {}
|
||||
"1" => &1 null
|
||||
|
|
@ -209,9 +253,10 @@ array:4 [
|
|||
"" => 2
|
||||
]
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
,
|
||||
$var
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function testObjectCast()
|
||||
|
|
@ -219,21 +264,33 @@ EOTXT
|
|||
$var = (object) array(1 => 1);
|
||||
$var->{1} = 2;
|
||||
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
if (\PHP_VERSION_ID >= 70200) {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
{
|
||||
+"1": 2
|
||||
}
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
} else {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
{
|
||||
+1: 1
|
||||
+"1": 2
|
||||
}
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
,
|
||||
$var
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function testClosedResource()
|
||||
{
|
||||
if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
||||
if (\defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
||||
|
|
@ -327,37 +384,23 @@ EOTXT
|
|||
$dumper->dump($data, $out);
|
||||
$out = stream_get_contents($out, -1, 0);
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
stream resource {@{$ref}
|
||||
⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {{$r}
|
||||
#message: "Unexpected Exception thrown from a caster: Foobar"
|
||||
trace: {
|
||||
%sTwig.php:2: {
|
||||
: foo bar
|
||||
: twig source
|
||||
:
|
||||
%sTwig.php:2 {
|
||||
› foo bar
|
||||
› twig source
|
||||
›
|
||||
}
|
||||
%sTemplate.php:%d: {
|
||||
: try {
|
||||
: \$this->doDisplay(\$context, \$blocks);
|
||||
: } catch (Twig%sError \$e) {
|
||||
}
|
||||
%sTemplate.php:%d: {
|
||||
: {
|
||||
: \$this->displayWithErrorHandling(\$this->env->mergeGlobals(\$context), array_merge(\$this->blocks, \$blocks));
|
||||
: }
|
||||
}
|
||||
%sTemplate.php:%d: {
|
||||
: try {
|
||||
: \$this->display(\$context);
|
||||
: } catch (%s \$e) {
|
||||
}
|
||||
%sCliDumperTest.php:%d: {
|
||||
%A
|
||||
}
|
||||
}
|
||||
%s%eTemplate.php:%d { …}
|
||||
%s%eTemplate.php:%d { …}
|
||||
%s%eTemplate.php:%d { …}
|
||||
%s%eTests%eDumper%eCliDumperTest.php:%d { …}
|
||||
%A }
|
||||
}
|
||||
%Awrapper_type: "PHP"
|
||||
stream_type: "MEMORY"
|
||||
|
|
@ -386,7 +429,7 @@ EOTXT
|
|||
$data = $cloner->cloneVar($var);
|
||||
$out = $dumper->dump($data, true);
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
{{$r}
|
||||
|
|
|
|||
6
pfosten/vendor/symfony/var-dumper/Tests/Dumper/HtmlDumperTest.php
vendored
Executable file → Normal file
6
pfosten/vendor/symfony/var-dumper/Tests/Dumper/HtmlDumperTest.php
vendored
Executable file → Normal file
|
|
@ -22,6 +22,10 @@ class HtmlDumperTest extends TestCase
|
|||
{
|
||||
public function testGet()
|
||||
{
|
||||
if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
|
||||
$this->markTestSkipped('A custom file_link_format is defined.');
|
||||
}
|
||||
|
||||
require __DIR__.'/../Fixtures/dumb-var.php';
|
||||
|
||||
$dumper = new HtmlDumper('php://output');
|
||||
|
|
@ -47,7 +51,7 @@ class HtmlDumperTest extends TestCase
|
|||
$dumpId = $dumpId[0];
|
||||
$res = (int) $var['res'];
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '<a class=sf-dump-ref>#%d</a>';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '<a class=sf-dump-ref>#%d</a>';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
<foo></foo><bar><span class=sf-dump-note>array:24</span> [<samp>
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/GeneratorDemo.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/GeneratorDemo.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/Twig.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/Twig.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php
vendored
Executable file → Normal file
Loading…
Add table
Add a link
Reference in a new issue