<commit_before><?php
namespace AmidaMVC\Tests\Application\AppSimple;
error_reporting( E_ALL );
require( __DIR__ . '/../../src/AmidaMVC/bootstrap.php' );

class testLoad extends \AmidaMVC\Tools\Load
{
    // still static!!!
    static $fileSys = array();
    static function setFiles( $files ) {
        static::$fileSys = $files;
    }
    static function getContentsByGet( $file_name ) {
        return ( isset( static::$fileSys[ $file_name ] ) ) ? static::$fileSys[ $file_name ]: FALSE;
    }
    static function getContentsByBuffer( $file_name ) {
        return static::getContentsByGet( $file_name );
    }
    function findFile( $file_name ) {
        $found = FALSE;
        if( empty( static::$_loadFolder ) ) return $found;
        foreach( static::$_loadFolder as $folder ) {
            $check_file = $folder. '/' . $file_name;
            if( isset( static::$fileSys[ $check_file ] ) ) {
                $found = $check_file;
                break;
            }
        }
        return $found;
    }
    function putContents( $filename, $content ) {
        static::$fileSys[ $filename ] = $content;
        return TRUE;
    }
    function exists( $filename ) {
        return isset( static::$fileSys[ $filename ] );
    }
    function mkDir( $dir, $permission ) {
        static::$fileSys[ $dir ] = NULL;
        return TRUE;
    }
    function rename( $file1, $file2 ) {
        static::$fileSys[ $file2 ] = static::$fileSys[ $file1 ];
        unset( static::$fileSys[ $file1 ] );
        return TRUE;
    }
    function isDir( $dir ) {
        if( array_key_exists( $dir, static::$fileSys ) && !isset( static::$fileSys[ $dir ] ) ) {
            return TRUE;
        }
        return FALSE;
    }
    function glob( $pattern, $flag=NULL ) {
        $found = array();
        if( strpos( $pattern, '{' ) !== FALSE ) {
            $pattern = substr( $pattern, 0, strpos( $pattern, '{' ) );
            $pattern .= substr( $pattern, strpos( $pattern, '{' ) + 1, strpos( $pattern, ',' ) );
        }
        foreach( static::$fileSys as $file => $content ) {
            if( substr( $file, 0, strlen( $pattern ) ) == $pattern ) {
                $found[] = $file;
            }
        }
        return $found;
    }
    function unlink( $filename ) {
        if( array_key_exists( $filename, static::$fileSys ) ) {
            unset( static::$fileSys[ $filename ] );
            return TRUE;
        }
        return FALSE;
    }
}

class test_ITest_AppSimple extends \PHPUnit_Framework_TestCase
{
    /** @var \AmidaMVC\Framework\Controller */
    var $app;
    /** @var \AmidaMVC\Framework\Container */
    var $di;
    /** @var array */
    var $req;
    function setUp() {
        $this->di = \AmidaMVC\Framework\Container::getInstance();
        $this->req = array(
            'REQUEST_METHOD' => 'GET',
            'REQUEST_URI' => '/url/to/',
            'SCRIPT_NAME' => '/path/to/',
        );
    }
    function test_1st() {
        $this->di->setModule( '\AmidaMVC\Tools\Request', '\AmidaMVC\Tools\Request', 'get', $this->req  );
        $this->app = \AmidaMVC\Application\Application::simple( array(
            '' => '',
        ) );
        $this->app->start();
        $this->assertTrue( FALSE );
    }
}<commit_msg>integration test using LoadArray; modified how to setup to make it work.<commit_after><?php
namespace AmidaMVC\Tests\Application\AppSimple;
error_reporting( E_ALL );
require( __DIR__ . '/../../src/AmidaMVC/bootstrap.php' );

use \AmidaMVC\Application\Application as TestApp;

class test_ITest_AppSimple extends \PHPUnit_Framework_TestCase
{
    /** @var \AmidaMVC\Framework\Controller */
    var $app;
    /** @var \AmidaMVC\Framework\Container */
    var $di;
    /** @var array */
    var $req;
    /** @var array */
    var $files;
    /** @var array */
    var $appConfig;
    function setUp() {
        $this->files = array(
            '/path/to/' => NULL,
            '/path/to/index.md' => "#Top of Array Data\n hello from Array!",
            '' => '',
        );
        $this->req = array(
            'REQUEST_METHOD' => 'GET',
            'REQUEST_URI' => '/',
            'SCRIPT_NAME' => '/path/to/_indexTest.php',
        );
        $this->appConfig = array(
            'site_title' => "TEST/Simple/array",
            'template_file' => NULL,
            'ctrl_root' => '/path/to/',
        );
        $this->di = \AmidaMVC\Framework\Container::getInstance();
        $this->di->setModule( '\AmidaMVC\Tools\Load', '\AmidaMVC\Tools\LoadArray', 'static' );
        $this->di->setModule( '\AmidaMVC\Tools\Request', '\AmidaMVC\Tools\Request', 'get', $this->req  );
        /** @var $load \AmidaMVC\Tools\LoadArray */
        $load = $this->di->get( '\AmidaMVC\Tools\LoadArray' );
        $load::setFiles( $this->files );
        $this->app = \AmidaMVC\Application\Application::simple( $this->appConfig );
    }
    function test_1st() {
        TestApp::simple( $this->appConfig )->start();
        //$this->app->start();
        $this->assertTrue( FALSE );
    }
}
{'fraction_non_alphanumeric': 0.16978503184713375, 'fraction_numerical': 0.0019904458598726115, 'mean_word_length': 2.12111801242236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '3088365', 'n_tokens_mistral': 1579, 'n_tokens_neox': 1589, 'n_words': 320}