コード例 #1
0
 public static function get($href, array $options = array())
 {
     if (substr($href, 0 - strlen(self::PATH)) != self::PATH) {
         $href = $href . '/' . self::PATH;
     }
     return Client::get($href, Stormpath::LINKEDIN_PROVIDER, Directory::PATH, $options);
 }
コード例 #2
0
 /**
  * Retreive a SAML Provider based on the Href.
  *
  * @since 1.13.0
  * @param string $href
  * @param array $options
  * @return \Stormpath\Resource\SamlProvider
  */
 public static function get($href, array $options = [])
 {
     if (substr($href, 0 - strlen(self::PATH)) != self::PATH) {
         $href = $href . '/' . self::PATH;
     }
     return Client::get($href, Stormpath::SAML_PROVIDER, null, $options);
 }
コード例 #3
0
 public function testShouldBeAbleToGetAccountViaHTMLFragment()
 {
     $account = \Stormpath\Resource\Account::instantiate(array('givenName' => 'Account Name', 'middleName' => 'Middle Name', 'surname' => 'Surname', 'username' => md5(time() . microtime() . uniqid()) . 'username', 'email' => md5(time() . microtime() . uniqid()) . '@unknown123.kot', 'password' => 'superP4ss'));
     self::$directory->createAccount($account);
     $href = $account->href;
     $hrefParts = array_reverse(explode('/', $account->href));
     $acct = \Stormpath\Resource\Account::get($hrefParts[0]);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Account', $account);
     $this->assertEquals($href, $acct->href);
     $acct2 = \Stormpath\Client::get($hrefParts[1] . '/' . $hrefParts[0], Stormpath::ACCOUNT);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Account', $acct2);
     $this->assertEquals($href, $acct2->href);
     $account->delete();
 }
コード例 #4
0
 public static function get($href, array $options = array())
 {
     return Client::get($href, self::class, self::PATH, $options);
 }
コード例 #5
0
 /**
  * @param $href
  * @param array $options
  * @return mixed
  */
 public static function get($href, array $options = array())
 {
     return Client::get($href, Stormpath::OAUTH_POLICY, self::PATH, $options);
 }
コード例 #6
0
 public static function get($href, array $options = array())
 {
     return Client::get($href, Stormpath::APPLICATION, self::PATH, $options);
 }
コード例 #7
0
 public function testShouldBeAbleToGetGroupViaHTMLFragment()
 {
     $group = \Stormpath\Resource\Group::instantiate(array('name' => makeUniqueName('GroupTest htmlFragment')));
     self::$directory->createGroup($group);
     $href = $group->href;
     $hrefParts = array_reverse(explode('/', $href));
     $group = \Stormpath\Resource\Group::get($hrefParts[0]);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Group', $group);
     $this->assertEquals($href, $group->href);
     $group2 = \Stormpath\Client::get($hrefParts[1] . '/' . $hrefParts[0], Stormpath::GROUP);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Group', $group2);
     $this->assertEquals($href, $group2->href);
     $group->delete();
 }
コード例 #8
0
 public function testShouldBeAbleToGetApplicationViaHTMLFragment()
 {
     $application = \Stormpath\Resource\Application::create(array('name' => makeUniqueName('ApplicationTest testFragment')));
     $href = $application->href;
     $hrefParts = array_reverse(explode('/', $href));
     $app = \Stormpath\Resource\Application::get($hrefParts[0]);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Application', $app);
     $this->assertEquals($href, $app->href);
     $app2 = \Stormpath\Client::get($hrefParts[1] . '/' . $hrefParts[0], Stormpath::APPLICATION);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Application', $app2);
     $this->assertEquals($href, $app2->href);
     $application->delete();
 }
コード例 #9
0
 public static function get($href, array $options = array())
 {
     return Client::get($href, Stormpath::ACCOUNT_STORE_MAPPING, self::PATH, $options);
 }
コード例 #10
0
 /**
  * @param $href
  * @param array $options
  * @return mixed
  */
 public static function get($href, array $options = [])
 {
     return Client::get($href, Stormpath::ACCESS_TOKEN, self::PATH, $options);
 }
コード例 #11
0
 public static function get($href, array $options = array())
 {
     return Client::get($href, Stormpath::GROUP_MEMBERSHIP, self::PATH, $options);
 }
コード例 #12
0
 public static function get($href, array $options = array())
 {
     return Client::get($href, Stormpath::DIRECTORY, self::PATH, $options);
 }
コード例 #13
0
 public function testShouldBeAbleToGetDirectoryViaHTMLFragment()
 {
     $directory = \Stormpath\Resource\Directory::create(array('name' => makeUniqueName('DirectoryTest htmlFragment')));
     $href = $directory->href;
     $hrefParts = array_reverse(explode('/', $href));
     $dir = \Stormpath\Resource\Directory::get($hrefParts[0]);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Directory', $dir);
     $this->assertEquals($href, $dir->href);
     $dir2 = \Stormpath\Client::get($hrefParts[1] . '/' . $hrefParts[0], Stormpath::DIRECTORY);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Directory', $dir2);
     $this->assertEquals($href, $dir2->href);
     $directory->delete();
 }