App example

/** * Loads up an instance of CodeIgniter * and gets the environment setup. * * @return CodeIgniter */
    protected function createApplication()
    {
        // Initialize the autoloader.         Services::autoloader()->initialize(new Autoload()new Modules());

        $app = new MockCodeIgniter(new App());
        $app->initialize();

        return $app;
    }

    /** * Return first matching emitted header. */
    protected function getHeaderEmitted(string $header, bool $ignoreCase = false, string $method = __METHOD__): ?string
    {
        if (function_exists('xdebug_get_headers')) {
            
$env = false;

        // Check the baseURL in .env         if (is_file(HOMEPATH . '.env')) {
            $env = preg_grep('/^app\.baseURL = ./', file(HOMEPATH . '.env')) !== false;
        }

        if ($env) {
            // BaseURL in .env is a valid URL?             // phpunit.xml.dist sets app.baseURL in $_SERVER             // So if you set app.baseURL in .env, it takes precedence             $config = new App();
            $this->assertTrue(
                $validation->check($config->baseURL, 'valid_url'),
                'baseURL "' . $config->baseURL . '" in .env is not valid URL'
            );
        }

        // Get the baseURL in app/Config/App.php         // You can't use Config\App, because phpunit.xml.dist sets app.baseURL         $reader = new ConfigReader();

        // BaseURL in app/Config/App.php is a valid URL?
Home | Imprint | This part of the site doesn't use cookies.