<commit_before><?php
namespace Bolt\Tests\Configuration;

use Bolt\Application;
use Bolt\Configuration\Standard;

/**
 * Class to test correct operation and locations of composer configuration.
 *
 * @author <NAME> <<EMAIL>>
 */
class StandardConfigurationTest extends \PHPUnit_Framework_TestCase
{
    public function testInitWithClassloader()
    {
        $loader = require BOLT_AUTOLOAD;
        $config = new Standard($loader);
        $app = new Application(['resources' => $config]);
        $this->assertEquals('/app/', $config->getUrl('app'));
    }
}<commit_msg>Fix Standard RM needing an autoloader 🙈<commit_after><?php
namespace Bolt\Tests\Configuration;

use Bolt\Application;
use Bolt\Configuration\Standard;
use Composer\Autoload\ClassLoader;
use Symfony\Component\Debug\DebugClassLoader;

/**
 * Class to test correct operation and locations of composer configuration.
 *
 * @author <NAME> <<EMAIL>>
 */
class StandardConfigurationTest extends \PHPUnit_Framework_TestCase
{
    public function testInitWithClassloader()
    {
        $loader = $this->getAutoLoader();
        $config = new Standard($loader);
        $app = new Application(['resources' => $config]);
        $this->assertEquals('/app/', $config->getUrl('app'));
    }

    private function getAutoLoader()
    {
        foreach (spl_autoload_functions() as $autoloader) {
            if (is_array($autoloader) && $autoloader[0] instanceof DebugClassLoader) {
                $autoloader = $autoloader[0]->getClassLoader();
            }
            if (!is_array($autoloader) || !$autoloader[0] instanceof ClassLoader) {
                continue;
            }
            if ($file = $autoloader[0]->findFile(ClassLoader::class)) {
                return $autoloader[0];
            }
        }

        throw new \RuntimeException('LOL WUT?');
    }
}
{'fraction_non_alphanumeric': 0.12908496732026145, 'fraction_numerical': 0.0027233115468409588, 'mean_word_length': 3.1004464285714284, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 18, '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': '3314586', 'n_tokens_mistral': 525, 'n_tokens_neox': 520, 'n_words': 116}