mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
27 lines
541 B
PHP
27 lines
541 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests;
|
|
|
|
use PHPUnit\Framework\Assert;
|
|
use Spatie\Snapshots\Driver;
|
|
|
|
class SnapshotPhpDriver implements Driver
|
|
{
|
|
public function serialize($data): string
|
|
{
|
|
return str_replace(["\r\n", "\r"], "\n", (string) $data);
|
|
}
|
|
|
|
public function extension(): string
|
|
{
|
|
return 'php';
|
|
}
|
|
|
|
public function match($expected, $actual)
|
|
{
|
|
Assert::assertSame(str_replace(["\r\n", "\r"], "\n", $expected), $this->serialize($actual));
|
|
}
|
|
}
|