expect($json)->toBeAnInstanceOf('Symfony\\Component\\HttpFoundation\\JsonResponse'); expect($json->getContent())->toBe('{"foo":"bar","baz":"bam"}'); }); }); describe("->abort()", function () { it("aborts the current request with a HttpException", function () { $closure = function () { $app = new Application(); $app->abort(405); }; expect($closure)->toThrow(new Siphon\Exception\HttpException(405)); }); it("aborts the current request with a NotFoundHttpException", function () { $closure = function () { $app = new Application(); $app->abort(404); }; expect($closure)->toThrow(new Siphon\Exception\NotFoundHttpException()); }); }); describe("default registered service definitions", function () { it("returns the default registered services", function () { $app = new Application(); $app->boot(); expect($app['app'] === $app)->toBe(true); expect($app)->toBeAnInstanceOf('Siphon\\ApplicationInterface')->toBeAnInstanceOf('Siphon\\Container\\ContainerInterface')->toBeAnInstanceOf('Symfony\\Component\\HttpKernel\\HttpKernelInterface')->toBeAnInstanceOf('Symfony\\Component\\HttpKernel\\TerminableInterface'); expect($app->get('router'))->toBeAnInstanceOf('Siphon\\Route\\RouteCollection'); expect($app['Siphon\\Event\\DispatcherInterface'])->toBeAnInstanceOf('Siphon\\Event\\Dispatcher'); expect($app['Siphon\\Event\\Dispatcher'])->toBeAnInstanceOf('Siphon\\Event\\Dispatcher'); expect($app['event'])->toBeAnInstanceOf('Siphon\\Event\\Dispatcher'); expect($app['Georgeff\\Filesystem\\File'])->toBeAnInstanceOf('Georgeff\\Filesystem\\File');