protected function doList()
 {
     // TODO sign the state with HMAC
     $state = json_encode(['userId' => $this->authenticationHelper->getLoggedInUserId()]);
     $this->setToView(['stores' => $this->getStoreBo()->getList($this->authenticationHelper->getLoggedInUserId()), 'connectUrl' => DiHelper::getInstance()->getFactory()->getOAuth()->getAuthorisationRedirectUrl($state)]);
     return new StoreListTemplate('stores', 'connectUrl');
 }
示例#2
0
 protected function setUp()
 {
     parent::setUp();
     $this->diContainer = new SystemContainer();
     Application::getInstance()->setDiContainer($this->diContainer);
     if ($this->initDiHelper) {
         DiHelper::init();
     }
     require realpath(__DIR__ . '/../../config.php');
 }
示例#3
0
 /**
  * Returns the current domain prefix
  *
  * @return string
  */
 protected function getDomainPrefix()
 {
     return DiHelper::getInstance()->getDomainPrefix();
 }
示例#4
0
 public function testGetFactory()
 {
     DiHelper::init();
     $helper = new DiHelper();
     $this->assertInstanceOf(Factory::class, $helper->getFactory(), 'Invalid return value for DiHelper::getFactory()');
 }
 /**
  * Returns an instance of OAuth.
  *
  * @return OAuth
  */
 protected function getOAuth()
 {
     return DiHelper::getInstance()->getFactory()->getOAuth();
 }