private function createHandler($options = array(), $notifyOnWarning = true) { EventHandler::reset(); $this->connection = new TestConnection(); $this->handler = EventHandler::start(1, $notifyOnWarning, $options); $this->handler->getClient()->setConnection($this->connection); }
/** * @dataProvider testMethodsProvider */ public function testMethods($expectedLevel, $methodName) { EventHandler::reset(); $connection = new TestConnection(); $options = array('errorReportingLevel' => $expectedLevel); $handler = EventHandler::start(1, true, $options); $handler->getClient()->setConnection($connection); $this->trigger->{$methodName}(); $this->assertEquals(1, $connection->sendCalls); }
/** * */ public static function initialize() { $airbrake_ini = Configuration::getSection('phpframework-airbrake'); if (!is_null($airbrake_ini) && Configuration::get('phpframework-airbrake', 'enable', FALSE)) { $apiKey = $airbrake_ini['api_key']; $airbrake_environment = isset($airbrake_ini['environment']) ? $airbrake_ini['environment'] : 'NO_ENVIRONMENT_SET'; $options = ['secure' => TRUE, 'host' => $airbrake_ini['host'], 'resource' => $airbrake_ini['resource'], 'timeout' => 10, 'environmentName' => Configuration::get('application', 'application') . ' / ' . $airbrake_environment]; \Airbrake\EventHandler::start($apiKey, FALSE, $options); $config = new \Airbrake\Configuration($apiKey, $options); self::$client = new \Airbrake\Client($config); } }
} else { if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == "https") { $protocol = 'https'; } elseif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { $protocol = 'https'; } define('ABSOLUTE_URL', $protocol . '://' . $_SERVER['SERVER_NAME'] . '/'); } } if (file_exists(BASE_PATH . 'bootstrap/serverconfig.php')) { include BASE_PATH . 'bootstrap/serverconfig.php'; } else { include BASE_PATH . 'bootstrap/serverconfig-default.php'; } if (defined('AIRBRAKE_TOKEN')) { \Airbrake\EventHandler::start(AIRBRAKE_TOKEN); } if (!defined('SPEED_FACTOR')) { define('SPEED_FACTOR', 1); } if (!defined('STATIC_ABSOLUTE_URL')) { define('STATIC_ABSOLUTE_URL', ABSOLUTE_URL); } if (!defined('GAME_NAME')) { define('GAME_NAME', 'Dolumar'); } // API if (!defined('API_FULL_URL')) { define('API_FULL_URL', ABSOLUTE_URL . 'api/'); } if (!defined('API_OPENID_URL')) {