From 5f9fa3c9b0dd8e711cc1ccb56a2588f8840359a0 Mon Sep 17 00:00:00 2001 From: Christian Blank Date: Sat, 8 Sep 2018 11:08:38 +0200 Subject: [PATCH] [#3234] Change r_print to var_export for diff generation of array subsets --- src/Framework/Constraint/ArraySubset.php | 4 ++-- tests/Framework/Constraint/ArraySubsetTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Framework/Constraint/ArraySubset.php b/src/Framework/Constraint/ArraySubset.php index 89cb2c7da3e..cd2de064485 100644 --- a/src/Framework/Constraint/ArraySubset.php +++ b/src/Framework/Constraint/ArraySubset.php @@ -78,8 +78,8 @@ public function evaluate($other, $description = '', $returnResult = false) $f = new ComparisonFailure( $patched, $other, - \print_r($patched, true), - \print_r($other, true) + \var_export($patched, true), + \var_export($other, true) ); $this->fail($other, $description, $f); diff --git a/tests/Framework/Constraint/ArraySubsetTest.php b/tests/Framework/Constraint/ArraySubsetTest.php index d887f952f89..0b6fa096aa6 100644 --- a/tests/Framework/Constraint/ArraySubsetTest.php +++ b/tests/Framework/Constraint/ArraySubsetTest.php @@ -79,8 +79,8 @@ public function testEvaluateFailMessage(): void } catch (ExpectationFailedException $expectedException) { $comparisonFailure = $expectedException->getComparisonFailure(); $this->assertNotNull($comparisonFailure); - $this->assertContains('[foo] => bar', $comparisonFailure->getExpectedAsString()); - $this->assertContains('[baz] => bar', $comparisonFailure->getActualAsString()); + $this->assertContains("'foo' => 'bar'", $comparisonFailure->getExpectedAsString()); + $this->assertContains("'baz' => 'bar'", $comparisonFailure->getActualAsString()); } } }