<commit_before><?php

namespace SimpleSAML\Test\Web;

use Symfony\Component\Yaml\Parser;
use PHPUnit\Framework\TestCase;
use \SimpleSAML\Configuration;
use \SimpleSAML\Module;

class RouterTest extends TestCase
{
    public function testSyntax()
    {
        $config = Configuration::loadFromArray([
            'module.enable' => array_fill_keys(Module::getModules(), true),
        ]);
        Configuration::setPreLoadedConfig($config);

        $yaml = new Parser();

        // Module templates
        foreach (Module::getModules() as $module) {
            $basedir = Module::getModuleDir($module);
            if (file_exists($basedir)) {
                $files = array_diff(scandir($basedir), ['.', '..']);
                foreach ($files as $file) {
                    if (preg_match('/.(yml|yaml)$/', $file)) {
                        try {
                            $value = $yaml->parse(file_get_contents('../../modules/'.$module.'/'.$file));
                            $this->addToAssertionCount(1);
                        } catch (\ParseException $e) {
                            $this->fail($e->getMessage().' in '.$e->getFile().':'.$e->getLine());
                        }
                    }
                }
            }
        }
    }
}<commit_msg>Fix path<commit_after><?php

namespace SimpleSAML\Test\Web;

use Symfony\Component\Yaml\Parser;
use PHPUnit\Framework\TestCase;
use \SimpleSAML\Configuration;
use \SimpleSAML\Module;

class RouterTest extends TestCase
{
    public function testSyntax()
    {
        $config = Configuration::loadFromArray([
            'module.enable' => array_fill_keys(Module::getModules(), true),
        ]);
        Configuration::setPreLoadedConfig($config);

        $yaml = new Parser();

        // Module templates
        foreach (Module::getModules() as $module) {
            $basedir = Module::getModuleDir($module);
            if (file_exists($basedir)) {
                $files = array_diff(scandir($basedir), ['.', '..']);
                foreach ($files as $file) {
                    if (preg_match('/.(yml|yaml)$/', $file)) {
                        try {
                            $value = $yaml->parse(file_get_contents('modules/'.$module.'/'.$file));
                            $this->addToAssertionCount(1);
                        } catch (\ParseException $e) {
                            $this->fail($e->getMessage().' in '.$e->getFile().':'.$e->getLine());
                        }
                    }
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.15366522932183457, 'fraction_numerical': 0.0007840062720501764, 'mean_word_length': 1.625514403292181, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7358143', 'n_tokens_mistral': 703, 'n_tokens_neox': 691, 'n_words': 113}