<?php declare(strict_types=1);

namespace Newland\NeosFiltering\Tests\Integration;

use Newland\NeosFiltering\Factory\DefaultFilterFactory;
use Newland\NeosFiltering\Items\Root;
use Newland\NeosFiltering\Tests\BaseTestCase;
use Symfony\Component\Yaml\Yaml;

class ArticleMinimalTest extends BaseTestCase
{

    public function testCreatesMinimalArticleFilterFromYaml(): void
    {
        $filter = $this->filterFromYaml();
        $this->assertTrue(true);
        // TODO Actually check the filter contents. This only checks for no exceptions.
    }

    private function filterFromYaml(): Root
    {
        $parsed = Yaml::parse(file_get_contents('resource://Newland.NeosFiltering/Private/ExampleConfigurations/ArticleMinimal.yaml'));

        return (new DefaultFilterFactory($this->node))->createFilter($parsed);
    }
}
