11
11
use SebastianBergmann \GlobalState \Snapshot ;
12
12
use SebastianBergmann \GlobalState \Restorer ;
13
13
use SebastianBergmann \GlobalState \Blacklist ;
14
- use SebastianBergmann \RecursionContext \Context ;
15
14
use SebastianBergmann \Exporter \Exporter ;
16
15
use Prophecy \Exception \Prediction \PredictionException ;
17
16
use Prophecy \Prophet ;
@@ -1665,45 +1664,6 @@ public static function onConsecutiveCalls()
1665
1664
return new PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls ($ args );
1666
1665
}
1667
1666
1668
- /**
1669
- * @param mixed $data The data to export as a string
1670
- * @param SebastianBergmann\RecursionContext\Context $processed Contains all objects and arrays that have previously been processed
1671
- * @return string
1672
- * @since Method available since Release 3.2.1
1673
- */
1674
- protected function dataToString (&$ data , $ processed = null )
1675
- {
1676
- $ result = array ();
1677
- $ exporter = new Exporter ();
1678
-
1679
- if (!$ processed ) {
1680
- $ processed = new Context ;
1681
- }
1682
-
1683
- $ processed ->add ($ data );
1684
-
1685
- foreach ($ data as $ key => $ value ) {
1686
- if (is_array ($ value )) {
1687
- if ($ processed ->contains ($ data [$ key ]) !== false ) {
1688
- $ result [] = '*RECURSION* ' ;
1689
- }
1690
-
1691
- else {
1692
- $ result [] = sprintf (
1693
- 'array(%s) ' ,
1694
- $ this ->dataToString ($ data [$ key ], $ processed )
1695
- );
1696
- }
1697
- }
1698
-
1699
- else {
1700
- $ result [] = $ exporter ->shortenedExport ($ value );
1701
- }
1702
- }
1703
-
1704
- return join (', ' , $ result );
1705
- }
1706
-
1707
1667
/**
1708
1668
* Gets the data set description of a TestCase.
1709
1669
*
@@ -1722,8 +1682,10 @@ protected function getDataSetAsString($includeData = true)
1722
1682
$ buffer .= sprintf (' with data set "%s" ' , $ this ->dataName );
1723
1683
}
1724
1684
1685
+ $ exporter = new Exporter ;
1686
+
1725
1687
if ($ includeData ) {
1726
- $ buffer .= sprintf (' (%s) ' , $ this -> dataToString ($ this ->data ));
1688
+ $ buffer .= sprintf (' (%s) ' , $ exporter -> shortenedRecursiveExport ($ this ->data ));
1727
1689
}
1728
1690
}
1729
1691
0 commit comments