/** * @test */ public function testError() { try { $this->app->error(); $this->assertTrue(false, 'app->error() should throw StopException'); } catch (StopException $e) { $this->assertTrue(true); $this->assertEquals(500, $this->app->response->getStatus()); } }
/** * @test */ public function testError() { $this->app->getContainer()->apilogger->setIsEnabled(false); try { $this->app->error(); $this->assertTrue(false, 'app->error() should throw StopException'); } catch (StopException $e) { $this->assertTrue(true); $this->assertEquals(500, $this->app->response->getStatus()); } }
/** * Gets default settings */ public static function getDefaultSettings() { return array_merge(parent::getDefaultSettings(), [self::SETTING_SCALR_ENVIRONMENT => null]); }
/** * {@inheritdoc} * @see Application::delete() */ public function delete($path, $options, $requirements = []) { return parent::delete($path, $options, $requirements)->addMethod(Request::METHOD_OPTIONS); }