public function testResponse() { $builder = new \Packaged\Dispatch\AssetResponse(); $asset = new \Packaged\Dispatch\Assets\CssAsset(); $request = \Symfony\Component\HttpFoundation\Request::createFromGlobals(); $asset->setContent('body{ background:blue; }'); $response = $builder->createResponse($asset, $request); $this->assertEquals('text/css', $response->headers->get('Content-Type')); $this->assertContains('background:blue', (string) $response); $this->assertInstanceOf('\\Symfony\\Component\\HttpFoundation\\Response', $response); $this->assertEquals(200, $response->getStatusCode()); $request->server->set('HTTP_IF_MODIFIED_SINCE', '1234'); $response = $builder->createResponse($asset, $request); $this->assertEquals(304, $response->getStatusCode()); }
public function testAsset() { $asset = new \Packaged\Dispatch\Assets\CssAsset(); $this->assertEquals('css', $asset->getExtension()); $this->assertEquals('text/css', $asset->getContentType()); }