public function testProdManifest() { $loader = $this->createManifestLoaderMock(); $loader->expects($this->once())->method('loadManifest')->with($this->isInstanceOf('SplFileInfo'), $this->equalTo('desktop'), $this->equalTo(false))->willReturn(new Manifest(__DIR__ . '__files/workspace/build/production/MyApp/app.json', array())); $app = new Application($this->createDefaultConfiguration(), $loader, 'prod'); $this->assertInstanceOf('TQ\\ExtJS\\Application\\Manifest\\Manifest', $app->getManifest()); }
/** * @param string $build * @param Request $request * @return Response */ public function manifestAction($build, Request $request) { $this->closeSession($request); try { $manifest = $this->application->getManifest($build); } catch (FileNotFoundException $e) { throw new NotFoundHttpException('Not Found', $e); } $response = new StreamedResponse(function () { echo ''; }); $response->setETag($manifest->computeETag())->setLastModified(\DateTime::createFromFormat('U', $manifest->getMTime()))->setPublic(); if ($response->isNotModified($request)) { return $response; } $response->setCallback(function () use($manifest) { echo $manifest->getContent(); }); $response->headers->set('Content-Type', 'application/json'); return $response; }