Exemplo n.º 1
0
 public function testRoutePut()
 {
     $router = new Core\Routing\Router();
     $router->put('/homepage', 'ControllerTest@index', 'homepage.update');
     $testRoute = $router->getRouteAlias('homepage.update')->getAlias();
     $this->assertEquals('homepage.update', $testRoute);
 }
Exemplo n.º 2
0
<?php

require_once '../vendor/autoload.php';
$uri = $_SERVER['REQUEST_URI'];
$log = new \Core\Logger\Log("access.log");
$log->add($uri);
$dir = __DIR__;
$path = substr($dir, strlen($_SERVER['DOCUMENT_ROOT']) - 1);
$route = substr($uri, strlen($path));
$router = new \Core\Routing\Router();
$response = $router->run($route);