Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/rentpix.corals.io/vendor/spatie/phpunit-snapshot-assertions/src/Drivers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/rentpix.corals.io/vendor/spatie/phpunit-snapshot-assertions/src/Drivers/YamlDriver.php
<?php

namespace Spatie\Snapshots\Drivers;

use PHPUnit\Framework\Assert;
use Spatie\Snapshots\Driver;
use Spatie\Snapshots\Exceptions\CantBeSerialized;
use Symfony\Component\Yaml\Yaml;

class YamlDriver implements Driver
{
    public function serialize($data): string
    {
        if (is_string($data)) {
            $data = Yaml::parse($data);
        }

        if (! is_array($data)) {
            throw new CantBeSerialized('Only arrays and strings can be serialized to yaml.');
        }

        return Yaml::dump($data, PHP_INT_MAX);
    }

    public function extension(): string
    {
        return 'yml';
    }

    public function match($expected, $actual)
    {
        if (is_array($actual)) {
            $actual = Yaml::dump($actual, PHP_INT_MAX);
        }

        Assert::assertEquals($expected, $actual);
    }
}

Spamworldpro Mini