public function testLoadServerWithNonExistentAction() { ob_start(); $_SERVER["QUERY_STRING"] = "Index/foo"; Server::Run(); $html = ob_get_contents(); ob_end_clean(); $this->assertTrue(strpos($html, "inside the view") <= 0); }
<?php require_once '../php/EventHttpServer.class.php'; class Server extends EventHttpServer { protected function ServerPush($Data) { echo "Push\n"; $ClientData = $this->getClientDataArray(); foreach ($ClientData as $SocketName => $Client) { $this->ClientWrite($SocketName, $Data); } } } $Server = new Server(); $Server->Run();
<?php /* * phpXelerator5 MVC * Bootstrap load the Autoloader and then loads all the required directories. * Then the constants are loaded and the Server Runs the application. * The server instantiates the Controller based on the first parameter passed * to Index.php, the seconds is the action and the rest are parameters. * * Version: 1.0 09/24/2015 * * @author Mauricio Giraldo <*****@*****.**> * */ include_once './bootstrap.php'; Server::Run();