mirror of
https://gh.wpcy.net/https://github.com/LJPc-solutions/freescout-calendar-module.git
synced 2026-07-15 17:15:21 +08:00
32 lines
No EOL
918 B
PHP
32 lines
No EOL
918 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Dallgoot\Yaml\Yaml;
|
|
|
|
final class DumpingTest extends TestCase
|
|
{
|
|
public static function dumpingCasesProvider()
|
|
{
|
|
$nameResultPair = get_object_vars(Yaml::parseFile(__DIR__.'/definitions/dumping_tests.yml'));
|
|
$generator = function() use($nameResultPair) {
|
|
foreach ($nameResultPair as $testName => $testResult) {
|
|
yield [$testName, $testResult];
|
|
}
|
|
};
|
|
return $generator();
|
|
}
|
|
|
|
/**
|
|
* @dataProvider dumpingCasesProvider
|
|
* @param string $fileName
|
|
* @param string $expected
|
|
* @coversNothing
|
|
*/
|
|
public function test_DumpingCases(string $fileName, string $expected)
|
|
{
|
|
$php = (include __DIR__."/cases/dumping/$fileName.php");
|
|
$output = Yaml::dump($php);
|
|
$this->assertEquals($expected, $output, "$fileName.php");
|
|
}
|
|
} |