public function dispatch(RequestInterface $request, ResponseInterface $response = null)
{
if (!$request instanceof ConsoleRequest) {
throw new \RuntimeException('You can use this controller only from a console!');
}
return parent::dispatch($request, $response);
}
public function testWarmupAction() { $this->routeMatch->setParam('action', 'warmup'); $this->controller->dispatch($this->request); $dumpedAsset = sys_get_temp_dir() . '/' . self::$assetName; $this->assertEquals(file_get_contents($dumpedAsset), JSMin::minify(file_get_contents(__DIR__ . '/../../_files/require-jquery.js'))); }