Beispiel #1
0
 public function testEditLinks()
 {
     $app = $this->getApp();
     $app['editlink'] = "editlink";
     $app['edittitle'] = "edittitle";
     $request = Request::create('/', 'GET');
     $response = $app->handle($request);
     $data = new BoltDataCollector($app);
     $data->collect($request, $response);
     $this->assertEquals("editlink", $data->getEditlink());
     $this->assertEquals("edittitle", $data->getEdittitle());
 }
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     parent::collect($request, $response, $exception);
     $access_token = $this->app['blimp_client.access_token']();
     $profile = $this->app['blimp_client.profile']();
     $has_token = !empty($access_token);
     $this->data = array_merge($this->data, ['branding_name' => $this->app['config']->get('general/branding/name'), 'blimp_version' => '1.0', 'backend_url' => $this->app['blimp_client.backend_url'], 'client_id' => $this->app['blimp_client.client_id'], 'client_secret' => $this->app['blimp_client.client_secret'], 'redirect_uri' => $this->app['blimp_client.redirect_uri'], 'scope' => $this->app['blimp_client.scope'], 'user_token' => $has_token ? 'yes' : 'no', 'role' => $has_token ? $access_token['scope'] : null, 'expires_at' => $has_token ? date("Y-m-d H:i:s", $access_token['best_before']) : null, 'profile_id' => $has_token ? $profile['id'] : null, 'profile_name' => $has_token ? $profile['name'] : null]);
 }