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