<commit_before><?php
namespace Aura\Web_Kernel;

use Aura\Project_Kernel\ProjectContainer;

class WebKernelTest extends \PHPUnit_Framework_TestCase
{
    protected $web_kernel;
    
    protected function exec()
    {
        // force into integration mode
        $_ENV['AURA_CONFIG_MODE'] = 'integration';
        
        // always have an HTTP_HOST or request uri won't get put together
        $_SERVER['HTTP_HOST'] = 'example.com';
        
        // retain from the kernel script
        $this->web_kernel = $this->index();
    }
    
    // this should be an exact copy of the web/index.php file
    protected function index()
    {
        // the project base directory
        $base = dirname(dirname(dirname(dirname(dirname(__DIR__)))));

        // set up autoloader
        $loader = require "$base/vendor/autoload.php";
        
        // include the web kernel tests/src dir
        $loader->addPsr4(
            'Aura\\Web_Kernel\\',
            "{$base}/vendor/aura/web-kernel/tests/src"
        );

        // load environment modifications
        require "{$base}/config/_env.php";

        // create the project container
        $di = ProjectContainer::factory($base, $loader, $_ENV, null);

        // create and invoke a web kernel
        $web_kernel = $di->newInstance('Aura\Web_Kernel\WebKernel');
        $web_kernel();
        
        // done!
        return $web_kernel;
    }
    
    public function testHelloWorld()
    {<commit_msg>use the project kernel script<commit_after><?php
namespace Aura\Web_Kernel;

use Aura\Project_Kernel\ProjectContainer;

class WebKernelTest extends \PHPUnit_Framework_TestCase
{
    protected $web_kernel;
    
    protected function exec()
    {
        // force into integration mode
        $_ENV['AURA_CONFIG_MODE'] = 'integration';
        
        // always have an HTTP_HOST or request uri won't get put together
        $_SERVER['HTTP_HOST'] = 'example.com';
        
        // retain from the kernel script
        $this->web_kernel = $this->index();
    }
    
    // equivalent to the web/index.php file
    protected function index()
    {
        // run the project kernel
        require dirname(dirname(dirname(dirname(dirname(__DIR__)))))
              . '/vendor/aura/project-kernel/scripts/kernel.php';

        // include the vendor/aura/web-kernel/tests/src dir
        $loader->addPsr4(
            'Aura\\Web_Kernel\\',
            "{$base}/vendor/aura/web-kernel/tests/src"
        );

        // create and invoke a web kernel
        $web_kernel = $di->newInstance('Aura\Web_Kernel\WebKernel');
        $web_kernel();
        
        // done!
        return $web_kernel;
    }
    
    public function testHelloWorld()
    {
{'fraction_non_alphanumeric': 0.11364472232438397, 'fraction_numerical': 0.000735564545788893, 'mean_word_length': 2.087400681044268, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3851011', 'n_tokens_mistral': 768, 'n_tokens_neox': 755, 'n_words': 184}