public function callingMain() { $temp = System::tempDir(); // Create web.ini in system's temp dir $ini = new \io\File($temp, 'web.ini'); $ini->open(FILE_MODE_WRITE); $ini->write("[app]\n" . "mappings=\"/:welcome\"\n" . "[app::welcome]\n" . "class=undefined\n" . "[app::welcome@dev]\n" . "class=\"" . self::$welcomeScriptlet->getName() . "\"\n"); $ini->close(); // Run ob_start(); Runner::main(array($temp, $temp, 'dev', '/')); $content = ob_get_contents(); ob_end_clean(); $ini->unlink(); // Assert $this->assertEquals('<h1>Welcome, we are open</h1>', $content); }