package and depencies
This commit is contained in:
@@ -22,7 +22,7 @@ trait VarDumperTestTrait
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
private $varDumperConfig = [
|
||||
private array $varDumperConfig = [
|
||||
'casters' => [],
|
||||
'flags' => null,
|
||||
];
|
||||
@@ -42,17 +42,17 @@ trait VarDumperTestTrait
|
||||
$this->varDumperConfig['flags'] = null;
|
||||
}
|
||||
|
||||
public function assertDumpEquals($expected, $data, int $filter = 0, string $message = '')
|
||||
public function assertDumpEquals(mixed $expected, mixed $data, int $filter = 0, string $message = '')
|
||||
{
|
||||
$this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
public function assertDumpMatchesFormat($expected, $data, int $filter = 0, string $message = '')
|
||||
public function assertDumpMatchesFormat(mixed $expected, mixed $data, int $filter = 0, string $message = '')
|
||||
{
|
||||
$this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
protected function getDump($data, $key = null, int $filter = 0): ?string
|
||||
protected function getDump(mixed $data, string|int $key = null, int $filter = 0): ?string
|
||||
{
|
||||
if (null === $flags = $this->varDumperConfig['flags']) {
|
||||
$flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
|
||||
@@ -73,7 +73,7 @@ trait VarDumperTestTrait
|
||||
return rtrim($dumper->dump($data, true));
|
||||
}
|
||||
|
||||
private function prepareExpectation($expected, int $filter): string
|
||||
private function prepareExpectation(mixed $expected, int $filter): string
|
||||
{
|
||||
if (!\is_string($expected)) {
|
||||
$expected = $this->getDump($expected, null, $filter);
|
||||
|
Reference in New Issue
Block a user