Skip to content

Commit e85198b

Browse files
Merge branch '4.5'
2 parents 68af76c + 397bcbe commit e85198b

File tree

2 files changed

+4
-39
lines changed

2 files changed

+4
-39
lines changed

composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"sebastian/comparator": "~1.1",
3434
"sebastian/diff": "~1.2",
3535
"sebastian/environment": "~1.2",
36-
"sebastian/exporter": "~1.1",
37-
"sebastian/recursion-context": "~1.0",
36+
"sebastian/exporter": "~1.2",
3837
"sebastian/global-state": "~1.0",
3938
"sebastian/version": "~1.0",
4039
"ext-dom": "*",

src/Framework/TestCase.php

+3-37
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use SebastianBergmann\GlobalState\Snapshot;
1212
use SebastianBergmann\GlobalState\Restorer;
1313
use SebastianBergmann\GlobalState\Blacklist;
14-
use SebastianBergmann\RecursionContext\Context;
1514
use SebastianBergmann\Exporter\Exporter;
1615
use Prophecy\Exception\Prediction\PredictionException;
1716
use Prophecy\Prophet;
@@ -1663,41 +1662,6 @@ public static function onConsecutiveCalls()
16631662
return new PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls($args);
16641663
}
16651664

1666-
/**
1667-
* @param mixed $data The data to export as a string
1668-
* @param SebastianBergmann\RecursionContext\Context $processed Contains all objects and arrays that have previously been processed
1669-
* @return string
1670-
* @since Method available since Release 3.2.1
1671-
*/
1672-
protected function dataToString(&$data, $processed = null)
1673-
{
1674-
$result = array();
1675-
$exporter = new Exporter();
1676-
1677-
if (!$processed) {
1678-
$processed = new Context;
1679-
}
1680-
1681-
$processed->add($data);
1682-
1683-
foreach ($data as $key => $value) {
1684-
if (is_array($value)) {
1685-
if ($processed->contains($data[$key]) !== false) {
1686-
$result[] = '*RECURSION*';
1687-
} else {
1688-
$result[] = sprintf(
1689-
'array(%s)',
1690-
$this->dataToString($data[$key], $processed)
1691-
);
1692-
}
1693-
} else {
1694-
$result[] = $exporter->shortenedExport($value);
1695-
}
1696-
}
1697-
1698-
return implode(', ', $result);
1699-
}
1700-
17011665
/**
17021666
* Gets the data set description of a TestCase.
17031667
*
@@ -1716,8 +1680,10 @@ protected function getDataSetAsString($includeData = true)
17161680
$buffer .= sprintf(' with data set "%s"', $this->dataName);
17171681
}
17181682

1683+
$exporter = new Exporter;
1684+
17191685
if ($includeData) {
1720-
$buffer .= sprintf(' (%s)', $this->dataToString($this->data));
1686+
$buffer .= sprintf(' (%s)', $exporter->shortenedRecursiveExport($this->data));
17211687
}
17221688
}
17231689

0 commit comments

Comments
 (0)