sebastianbergmann/phpunit — pull request #440 by dzuelke (2011-12-14 21:23:17+00:00)
Title: Use var_export for serialized data instead of addcslashes

When running tests in process isolation and data from a data provider contains null bytes, the `addcslashes()` call will screw up the serialized string and PHP will crash with a few lines of question marks and other garbage output.

Since it's a bad idea anyway to ever fiddle with the output of `serialize()`, I've replaced all the occurrences of `addcslashes()`, not just the one causing the crash, with `var_export()`.

I also put a fix in place that makes sure existing process isolation test case method templates will continue to work without breaking, as they contain stuff like

```
unserialize('{data}')
```

which means we need to generate an immediate closing single quote, a dot, then the `var_export()`ed value, then another dot and the opening single quote for the trailing single quote in the template.

I guess for 4.0 it'd be fine to change the templates accordingly and just get rid of the extra wrapping (that's why I've put them on separate lines even though it's less efficient, but in the grand scheme of things it doesn't even matter since process isolation itself is the much bigger overhead).

Tested to work fine.