當前位置: 首頁>>代碼示例>>PHP>>正文


PHP makeUniqueName函數代碼示例

本文整理匯總了PHP中makeUniqueName函數的典型用法代碼示例。如果您正苦於以下問題:PHP makeUniqueName函數的具體用法?PHP makeUniqueName怎麽用?PHP makeUniqueName使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了makeUniqueName函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetFacebookProvider

 public function testGetFacebookProvider()
 {
     $clientId = makeUniqueName("mockClientId");
     $clientSecret = makeUniqueName("mockClientSecret");
     $provider = self::$client->dataStore->instantiate(\Stormpath\Stormpath::FACEBOOK_PROVIDER);
     $provider->clientId = $clientId;
     $provider->clientSecret = $clientSecret;
     $directoryName = makeUniqueName("my-facebook-directory-2");
     $directoryDescription = makeUniqueName("A Facebook directory");
     $directory = self::$client->dataStore->instantiate(\Stormpath\Stormpath::DIRECTORY);
     $directory->name = $directoryName;
     $directory->description = $directoryDescription;
     $directory->provider = $provider;
     $tenant = self::$client->getCurrentTenant();
     $returnedDirectory = $tenant->createDirectory($directory);
     $this->assertNotNull($returnedDirectory);
     $returnedProvider = self::$client->dataStore->getResource($returnedDirectory->href . "/" . Provider::PATH, \Stormpath\Stormpath::FACEBOOK_PROVIDER);
     $this->assertEquals(FacebookProvider::FACEBOOK_PROVIDER_ID, $returnedProvider->providerId);
     $this->assertNotEmpty($returnedProvider->createdAt);
     $this->assertNotEmpty($returnedProvider->modifiedAt);
     $this->assertEquals($clientId, $returnedProvider->clientId);
     $this->assertEquals($clientSecret, $returnedProvider->clientSecret);
     $tokens = explode('/', $returnedDirectory->href);
     $directoryId = end($tokens);
     $this->assertEquals($returnedProvider, FacebookProvider::get($directoryId));
     $this->assertEquals($returnedProvider, FacebookProvider::get($directoryId . '/' . Provider::PATH));
     $this->assertEquals($returnedProvider, FacebookProvider::get(Directory::PATH . '/' . $directoryId . '/' . Provider::PATH));
     $this->assertEquals($returnedProvider, FacebookProvider::get($returnedDirectory->href));
     $this->assertEquals($returnedProvider, FacebookProvider::get($returnedDirectory->href . '/' . Provider::PATH));
     $returnedDirectory->delete();
 }
開發者ID:feddu,項目名稱:stormpath-sdk-php,代碼行數:31,代碼來源:ProviderTest.php

示例2: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$application = \Stormpath\Resource\Application::instantiate(array('name' => makeUniqueName('Application ApiRequestAuthenticatorTest'), 'description' => 'Application for ApiRequestAuthenticatorTest', 'status' => 'enabled'));
     parent::createResource(\Stormpath\Resource\Application::PATH, self::$application, array('createDirectory' => true));
     self::$account = \Stormpath\Resource\Account::instantiate(array('givenName' => 'PHP', 'middleName' => 'ApiRequestAuthenticatorTest', 'surname' => 'Test', 'username' => makeUniqueName('ApiRequestAuthenticatorTest'), 'email' => makeUniqueName('ApiRequestAuthenticatorTest') . '@unknown123.kot', 'password' => 'superP4ss'));
     self::$application->createAccount(self::$account);
     self::$apiKey = self::$account->createApiKey();
 }
開發者ID:InfinityCCS,項目名稱:stormpath-sdk-php,代碼行數:9,代碼來源:ApiRequestAuthenticatorTest.php

示例3: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$samlProvider = \Stormpath\Resource\SamlProvider::instantiate(['ssoLoginUrl' => 'http://google.com/login', 'ssoLogoutUrl' => 'http://google.com/logout', 'encodedX509SigningCert' => self::getDummyCertForSaml(), 'requestSignatureAlgorithm' => 'RSA-SHA1']);
     self::$directory = \Stormpath\Resource\Directory::create(['name' => makeUniqueName('DirectoryTest samlProvider'), 'provider' => self::$samlProvider]);
     $parts = explode('/', self::$directory->href);
     self::$directoryId = end($parts);
     self::$metadata = SamlProvider::get(self::$directory->provider->href)->serviceProviderMetadata;
 }
開發者ID:CHANDRA-BHUSHAN-SAH,項目名稱:stormpath-sdk-php,代碼行數:9,代碼來源:SamlProviderMetadataTest.php

示例4: testCreateDirectory

 public function testCreateDirectory()
 {
     $tenant = self::$client->tenant;
     $name = makeUniqueName('TenantTest createDirectory');
     $directory = \Stormpath\Resource\Directory::instantiate(array('name' => $name));
     $tenant->createDirectory($directory);
     //$this->assertInstanceOf('\Stormpath\Resource\Directory', $directory);
     $this->assertEquals($tenant->name, $directory->tenant->name);
     $this->assertEquals($name, $directory->name);
     foreach ($tenant->directories as $dir) {
         $this->assertInstanceOf('\\Stormpath\\Resource\\Directory', $dir);
     }
     $directory->delete();
 }
開發者ID:feddu,項目名稱:stormpath-sdk-php,代碼行數:14,代碼來源:TenantTest.php

示例5: testDelete

 /**
  * @expectedException \Stormpath\Resource\ResourceError
  */
 public function testDelete()
 {
     $group = \Stormpath\Resource\Group::instantiate(array('name' => makeUniqueName('GroupMembershipTest testDelete')));
     self::$directory->createGroup($group);
     $account = \Stormpath\Resource\Account::instantiate(array('givenName' => 'Account Name', 'surname' => 'Surname', 'email' => makeUniqueName('GroupMembershipTest testDelete') . '@unknown12345678.kot', 'password' => 'superP4ss'));
     self::$directory->createAccount($account);
     $groupMembership = \Stormpath\Resource\GroupMembership::create(array('account' => $account, 'group' => $group));
     $groupMembership = \Stormpath\Resource\GroupMembership::get($groupMembership->href);
     $this->assertInstanceOf('\\Stormpath\\Resource\\GroupMembership', $groupMembership);
     $this->assertContains('testDelete', $groupMembership->group->name);
     $this->assertContains('@unknown12345678.kot', $groupMembership->account->email);
     $href = $groupMembership->href;
     $groupMembership->delete();
     \Stormpath\Resource\GroupMembership::get($href);
 }
開發者ID:feddu,項目名稱:stormpath-sdk-php,代碼行數:18,代碼來源:GroupMembershipTest.php

示例6: createDirectory

 private function createDirectory()
 {
     $directory = \Stormpath\Resource\Directory::instantiate(array('name' => makeUniqueName('Directory For Request Signer Test'), 'description' => 'Main Directory description'));
     return self::createResource(\Stormpath\Resource\Directory::PATH, $directory);
 }
開發者ID:feddu,項目名稱:stormpath-sdk-php,代碼行數:5,代碼來源:RequestSignerTest.php

示例7: it_can_add_an_account_store_mapping

 /**
  * @test
  */
 public function it_can_add_an_account_store_mapping()
 {
     $application = \Stormpath\Resource\Application::instantiate(['name' => makeUniqueName('OrgTest'), 'description' => 'Description of Main App', 'status' => 'enabled']);
     $application = self::createResource(\Stormpath\Resource\Application::PATH, $application);
     $accountStoreMapping = \Stormpath\Resource\AccountStoreMapping::instantiate(['organization' => self::$organization, 'accountStore' => self::$directory, 'isDefaultAccountStore' => true, 'isDefaultGroupStore' => true]);
     $test1 = self::$organization->createOrganizationAccountStoreMapping($accountStoreMapping);
     $this->assertInstanceOf('\\Stormpath\\Resource\\AccountStoreMapping', $test1);
     $accountStoreMapping = \Stormpath\Resource\AccountStoreMapping::instantiate(['accountStore' => self::$organization, 'application' => $application, 'isDefaultAccountStore' => true]);
     $test2 = $application->createAccountStoreMapping($accountStoreMapping);
     $this->assertInstanceOf('\\Stormpath\\Resource\\AccountStoreMapping', $test2);
     $org = Organization::get(self::$organization->href);
     $this->assertNotNull($org->accountStoreMappings->href);
     $this->assertInstanceOf('Stormpath\\Resource\\AccountStore', $org->defaultAccountStoreMapping);
     $this->assertInstanceOf('Stormpath\\Resource\\AccountStore', $org->defaultGroupStoreMapping);
     $asm = $org->accountStoreMappings;
     foreach ($asm as $mapping) {
         $this->assertEquals($org->href, $mapping->organization->href);
         $this->assertEquals(self::$directory->href, $mapping->accountStore->href);
     }
     $app = Application::get($application->href);
     $this->assertNotNull($app->accountStoreMappings->href);
     $asm = $app->accountStoreMappings;
     foreach ($asm as $mapping) {
         $this->assertEquals($app->href, $mapping->application->href);
         $this->assertEquals(self::$organization->href, $mapping->accountStore->href);
     }
     $application->delete();
 }
開發者ID:CHANDRA-BHUSHAN-SAH,項目名稱:stormpath-sdk-php,代碼行數:31,代碼來源:OrganizationTest.php

示例8: testShouldBeAbleToGetGroupViaHTMLFragment

 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();
 }
開發者ID:CHANDRA-BHUSHAN-SAH,項目名稱:stormpath-sdk-php,代碼行數:14,代碼來源:GroupTest.php

示例9: an_application_should_allow_setting_authorized_callback_uri

 /** @test */
 public function an_application_should_allow_setting_authorized_callback_uri()
 {
     $application = \Stormpath\Resource\Application::create(array('name' => makeUniqueName('ApplicationTest authorizedCallbackUri')));
     $application->setAuthorizedCallbackUris(['http://myapplication.com/whatever/callback', 'http://myapplication.com/whatever/callback2']);
     $application->save();
     $application = \Stormpath\Resource\Application::get($application->href);
     $this->assertCount(2, $application->authorizedCallbackUris);
     $application->delete();
 }
開發者ID:CHANDRA-BHUSHAN-SAH,項目名稱:stormpath-sdk-php,代碼行數:10,代碼來源:ApplicationTest.php

示例10: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$directory = \Stormpath\Resource\Directory::create(array('name' => makeUniqueName('AccountCreationPolicyTest')));
     self::$acp = self::$directory->accountCreationPolicy;
 }
開發者ID:CHANDRA-BHUSHAN-SAH,項目名稱:stormpath-sdk-php,代碼行數:6,代碼來源:AccountCreationPolicyTest.php

示例11: testShouldBeAbleToGetDirectoryViaHTMLFragment

 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();
 }
開發者ID:InfinityCCS,項目名稱:stormpath-sdk-php,代碼行數:13,代碼來源:DirectoryTest.php

示例12: a_directory_can_add_a_saml_provider

 /** @test */
 public function a_directory_can_add_a_saml_provider()
 {
     $samlProvider = \Stormpath\Resource\SamlProvider::instantiate(['ssoLoginUrl' => 'http://google.com/login', 'ssoLogoutUrl' => 'http://google.com/logout', 'encodedX509SigningCert' => $this->getDummyCertForSaml(), 'requestSignatureAlgorithm' => 'RSA-SHA1']);
     $directory = \Stormpath\Resource\Directory::create(['name' => makeUniqueName('DirectoryTest samlProvider'), 'provider' => $samlProvider]);
     $this->assertInstanceOf('Stormpath\\Resource\\Directory', $directory);
     $this->assertInstanceOf('Stormpath\\Resource\\Provider', $directory->provider);
     $this->assertEquals('saml', $directory->provider->providerId);
     $directory->delete();
 }
開發者ID:CHANDRA-BHUSHAN-SAH,項目名稱:stormpath-sdk-php,代碼行數:10,代碼來源:DirectoryTest.php

示例13: testDelete

 /**
  * @expectedException \Stormpath\Resource\ResourceError
  */
 public function testDelete()
 {
     $application = \Stormpath\Resource\Application::create(array('name' => makeUniqueName('ApplicationTest testDelete')));
     $this->assertInstanceOf('Stormpath\\Resource\\Application', $application);
     $this->assertContains('testDelete', $application->name);
     $href = $application->href;
     $application->delete();
     \Stormpath\Resource\Application::get($href);
 }
開發者ID:feddu,項目名稱:stormpath-sdk-php,代碼行數:12,代碼來源:ApplicationTest.php

示例14: testDelete

 public function testDelete()
 {
     $application = \Stormpath\Resource\Application::instantiate(array('name' => makeUniqueName('AccountStoreMappingTest Test Delete')));
     self::createResource(\Stormpath\Resource\Application::PATH, $application);
     $accountStoreMappingWithDir = \Stormpath\Resource\AccountStoreMapping::create(array('accountStore' => self::$directory, 'application' => $application));
     $href = $accountStoreMappingWithDir->href;
     $accountStoreMapping = \Stormpath\Resource\AccountStoreMapping::get($href);
     $this->assertInstanceOf('Stormpath\\Resource\\AccountStoreMapping', $accountStoreMapping);
     $this->assertInstanceOf('Stormpath\\Resource\\Directory', $accountStoreMapping->accountStore);
     $accountStoreMapping->delete();
     try {
         \Stormpath\Resource\AccountStoreMapping::get($href);
         $application->delete();
         $this->fail('Should have thrown a ResourceError.');
     } catch (\Stormpath\Resource\ResourceError $re) {
         $this->assertTrue(true);
     }
     $application->delete();
 }
開發者ID:feddu,項目名稱:stormpath-sdk-php,代碼行數:19,代碼來源:AccountStoreMappingTest.php

示例15: testShouldBeAbleToGetApplicationViaHTMLFragment

 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();
 }
開發者ID:InfinityCCS,項目名稱:stormpath-sdk-php,代碼行數:13,代碼來源:ApplicationTest.php


注:本文中的makeUniqueName函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。