feature #16063 [VarDumper] Add $this->getDump($var) when using VarDumperTestTrait (nicolas-grekas)
This PR was merged into the 2.8 branch.
Discussion
----------
[VarDumper] Add $this->getDump($var) when using VarDumperTestTrait
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
So useful when writing/updating dump fixtures!
Commits
-------
aa1d578
[VarDumper] Add $this->getDump($var) when using VarDumperTestTrait
This commit is contained in:
commit
6413fb7743
@ -21,15 +21,15 @@ trait VarDumperTestTrait
|
||||
{
|
||||
public function assertDumpEquals($dump, $data, $message = '')
|
||||
{
|
||||
$this->assertSame(rtrim($dump), $this->getVarDumperDump($data), $message);
|
||||
$this->assertSame(rtrim($dump), $this->getDump($data), $message);
|
||||
}
|
||||
|
||||
public function assertDumpMatchesFormat($dump, $data, $message = '')
|
||||
{
|
||||
$this->assertStringMatchesFormat(rtrim($dump), $this->getVarDumperDump($data), $message);
|
||||
$this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data), $message);
|
||||
}
|
||||
|
||||
private function getVarDumperDump($data)
|
||||
public function getDump($data)
|
||||
{
|
||||
$h = fopen('php://memory', 'r+b');
|
||||
$cloner = new VarCloner();
|
||||
|
Reference in New Issue
Block a user