Esempio n. 1
0
 public function testDirectResponse()
 {
     $rsp = new \Symfony\Component\HttpFoundation\Response();
     $this->object->register('TestDirectResponse', ProxyFactory::factory(function () use($rsp) {
         return $rsp;
     }));
     $request = Request::create('/TestDirectResponse.action');
     $response = $this->object->run($request);
     $this->assertEquals($rsp, $response);
 }
Esempio n. 2
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
use Fwk\Core\Application, Fwk\Core\Descriptor;
$desc = new Descriptor(__DIR__ . '/../Nitronet/fwk.xml');
$app = new Application($desc);
$app->run(\Symfony\Component\HttpFoundation\Request::createFromGlobals());
Esempio n. 3
0
 public function testChainResultType()
 {
     $req = Request::create('/HomeChain.action');
     $result = $this->app->run($req);
     $this->assertInstanceOf('\\Symfony\\Component\\HttpFoundation\\JsonResponse', $result);
 }
Esempio n. 4
0
 public function testRoutesFromDescriptor()
 {
     $req = Request::create('/hello/joe');
     $result = $this->app->run($req);
     $this->assertInstanceOf('\\Symfony\\Component\\HttpFoundation\\JsonResponse', $result);
 }