示例#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);
 }
示例#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());
示例#3
0
 public function testChainResultType()
 {
     $req = Request::create('/HomeChain.action');
     $result = $this->app->run($req);
     $this->assertInstanceOf('\\Symfony\\Component\\HttpFoundation\\JsonResponse', $result);
 }
示例#4
0
 public function testRoutesFromDescriptor()
 {
     $req = Request::create('/hello/joe');
     $result = $this->app->run($req);
     $this->assertInstanceOf('\\Symfony\\Component\\HttpFoundation\\JsonResponse', $result);
 }