public function test_should_dispatcher_works_fine()
 {
     \Myfox\App\Dispatcher::run(__DIR__ . '/ini/myfox.ini', $this->prefix . '/', null);
     $this->assertContains('<!--STATUS OK-->', ob_get_clean());
     $this->assertContains("\tREQUEST\t-\t{\"url\":\"\\/\",\"post\":[]}", self::getLogContents($this->logfile, -1));
     \Myfox\App\Dispatcher::run(__DIR__ . '/ini/myfox.ini', $this->prefix . '/i_am_not_exist', 'a[]=b&c1=' . urlencode('//'));
     $this->assertContains("\tEXCEPTION\t-\t{\"url\":\"\\/i_am_not_exist\",\"post\":{\"a\":[\"b\"],\"c1\":\"\\/\\/\"},\"error\":", self::getLogContents($this->logfile, -1));
 }
Ejemplo n.º 2
0
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
require_once __DIR__ . '/../app/dispatcher.php';
\Myfox\App\Dispatcher::run(__DIR__ . '/../etc/myfox.ini', isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', file_get_contents('php://input'));