phpOMS/tests/Utils/Parser/Calendar/ICalParserTest.php
Dennis Eichhorn 31a77c08e5 fix tests
2023-10-22 22:25:59 +00:00

43 lines
985 B
PHP

<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace phpOMS\tests\Utils\Parser\Calendar;
include_once __DIR__ . '/../../../Autoloader.php';
use phpOMS\System\File\Local\Directory;
use phpOMS\Utils\Parser\Calendar\ICalParser;
/**
* @internal
*/
final class ICalParserTest extends \PHPUnit\Framework\TestCase
{
public function testParsing() : void
{
$files = Directory::list(__DIR__ . '/data');
foreach ($files as $file) {
$data = \explode('.', $file);
if ($data[1] === 'ical') {
self::assertEquals(
\json_decode(\file_get_contents(__DIR__ . '/data/' . $data[0] . '.json'), true),
ICalParser::parse(\file_get_contents(__DIR__ . '/data/' . $data[0] . '.ical'))
);
}
}
}
}