Esempio n. 1
0
 /**
  * @return \Fusio\Engine\Context
  */
 protected function getContext()
 {
     $app = new App();
     $app->setAnonymous(false);
     $app->setId(3);
     $app->setUserId(2);
     $app->setStatus(1);
     $app->setName('Foo-App');
     $app->setUrl('http://google.com');
     $app->setParameters(['foo' => 'bar']);
     $app->setScopes(['foo', 'bar']);
     $app->setAppKey('5347307d-d801-4075-9aaa-a21a29a448c5');
     $user = new User();
     $user->setAnonymous(false);
     $user->setId(2);
     $user->setStatus(0);
     $user->setName('Consumer');
     $action = new Action();
     $action->setId(uniqid());
     $action->setName('foo');
     $action->setDate(date('Y-m-d H:i:s'));
     return new Context(34, $app, $user, $action);
 }
Esempio n. 2
0
 protected function newApp(array $row)
 {
     $parameters = [];
     if (!empty($row['parameters'])) {
         parse_str($row['parameters'], $parameters);
     }
     $app = new App();
     $app->setId($row['id']);
     $app->setUserId($row['userId']);
     $app->setStatus($row['status']);
     $app->setName($row['name']);
     $app->setUrl($row['url']);
     $app->setParameters($parameters);
     $app->setAppKey($row['appKey']);
     return $app;
 }