8000 [VarDumper] fix tests when xdebug is enabled by FrancescoBorzi · Pull Request #20785 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[VarDumper] fix tests when xdebug is enabled #20785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest"
*/
public function testGenerator()
{
if (extension_loaded('xdebug')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be skipped only when xdebug.overload_var_dump is set to 2:

  • 0 does not overload var_dump at all
  • 1 overloads it only with formatting, which does not break our tests AFAIK
  • 2 adds the location to the formatted output.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true, but for the next patch (this one is independent from var_dump)

$this->markTestSkipped('xdebug is active');
}

$g = new GeneratorDemo();
$g = $g->baz();
$r = new \ReflectionGenerator($g);
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/VarDumper/Tests/VarClonerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ public function testClone()

public function testJsonCast()
{
if (ini_get('xdebug.overload_var_dump') == 2) {
$this->markTestSkipped('xdebug is active');
}

$data = (array) json_decode('{"1":{}}');

$cloner = new VarCloner();
Expand Down
0