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


PHP Phake::initAnnotations方法代碼示例

本文整理匯總了PHP中Phake::initAnnotations方法的典型用法代碼示例。如果您正苦於以下問題:PHP Phake::initAnnotations方法的具體用法?PHP Phake::initAnnotations怎麽用?PHP Phake::initAnnotations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Phake的用法示例。


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

示例1: setUp

 /**
  * Sets up the test fixture
  */
 public function setUp()
 {
     Phake::initAnnotations($this);
     $this->matcher = $this->getMock('Phake_Matchers_MethodMatcher', array(), array(), '', false);
     $this->stubMapper = Phake::mock('Phake_Stubber_StubMapper');
     $this->binder = new Phake_Stubber_AnswerBinder($this->matcher, $this->stubMapper);
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:10,代碼來源:AnswerBinderTest.php

示例2: setUp

 protected function setUp()
 {
     Phake::initAnnotations($this);
     $this->template = new LaunchKey_WP_Template(__DIR__ . '/__fixtures', $this->facade, 'test-language-domain');
     Phake::when($this->facade)->__(Phake::anyParameters())->thenReturnCallback(function ($method, $parameters) {
         return sprintf('Translated [%s]', $parameters[0]);
     });
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:8,代碼來源:class-launchkey-wp-template-test.php

示例3: setUp

 public function setUp()
 {
     Phake::initAnnotations($this);
     $this->registry = new Phake_Mock_InfoRegistry();
     $this->registry->addInfo($this->info1);
     $this->registry->addInfo($this->info2);
     $this->registry->addInfo($this->info3);
 }
開發者ID:svpernova09,項目名稱:Phake,代碼行數:8,代碼來源:InfoRegistryTest.php

示例4: setUp

 protected function setUp()
 {
     Phake::initAnnotations($this);
     Phake::when($this->wpdb)->get_var(Phake::anyParameters())->thenReturn('true');
     $this->wpdb->usermeta = 'usermeta_table_name';
     $this->user->ID = 'User ID';
     $this->client = new LaunchKey_WP_SSO_Client($this->facade, $this->template, static::ENTITY_ID, $this->saml_response_service, $this->saml_request_service, $this->wpdb, static::LOGIN_URL, static::LOGOUT_URL, static::ERROR_URL, false);
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:8,代碼來源:class-launchkey-wp-sso-client-test-abstract.php

示例5: setUp

 protected function setUp()
 {
     Phake::initAnnotations($this);
     Phake::when($this->container)->generateId(Phake::anyParameters())->thenReturn(static::UNIQUE_ID);
     SAML2_Compat_ContainerSingleton::setContainer($this->container);
     $this->service = new LaunchKey_WP_SAML2_Request_Service(self::$key);
     $this->service->load_saml_request(self::$request_data);
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:8,代碼來源:class-launchkey-wp-saml2-request-service-test.php

示例6: setUp

 public function setUp()
 {
     Phake::initAnnotations($this);
     $this->mock = $this->getMock('Phake_IMock');
     $this->stubMapper = Phake::mock('Phake_Stubber_StubMapper');
     $this->defaultAnswer = Phake::mock('Phake_Stubber_IAnswer');
     Phake::when($this->defaultAnswer)->getAnswerCallback('foo')->thenReturn(function () {
         return '24';
     });
     $this->answerCollection = Phake::mock('Phake_Stubber_AnswerCollection');
     $answer = Phake::mock('Phake_Stubber_IAnswer');
     Phake::when($this->answerCollection)->getAnswer()->thenReturn($answer);
     Phake::when($answer)->getAnswerCallback($this->anything(), 'foo')->thenReturn(function () {
         return '42';
     });
     Phake::when($this->stubMapper)->getStubByCall(Phake::anyParameters())->thenReturn($this->answerCollection);
     $this->handler = new Phake_ClassGenerator_InvocationHandler_StubCaller($this->stubMapper, $this->defaultAnswer);
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:18,代碼來源:StubCallerTest.php

示例7: setUp

 protected function setUp()
 {
     $that = $this;
     $this->options_data = array(LaunchKey_WP_Options::OPTION_IMPLEMENTATION_TYPE => LaunchKey_WP_Implementation_Type::NATIVE, LaunchKey_WP_Options::OPTION_ROCKET_KEY => 12345, LaunchKey_WP_Options::OPTION_SECRET_KEY => 'Secret Key', LaunchKey_WP_Options::OPTION_PRIVATE_KEY => 'Private Key', LaunchKey_WP_Options::OPTION_APP_DISPLAY_NAME => 'LaunchKey', LaunchKey_WP_Options::OPTION_SSL_VERIFY => true);
     Phake::initAnnotations($this);
     Phake::when($this->admin)->check_option(Phake::anyParameters())->thenReturn(array(array(), array()));
     Phake::when($this->facade)->get_option(LaunchKey_WP_Admin::OPTION_KEY)->thenReturnCallback(function () use($that) {
         return $that->options_data;
     });
     Phake::when($this->facade)->wp_create_nonce(Phake::anyParameters())->thenReturn('Nonce');
     Phake::when($this->facade)->wp_verify_nonce(Phake::anyParameters())->thenReturn(true);
     Phake::when($this->facade)->__(Phake::anyParameters())->thenReturnCallback(function ($method, $parameters) {
         return sprintf('TRANSLATED [%s]', $parameters[0]);
     });
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $_POST['action'] = null;
     $this->wizard = new LaunchKey_WP_Configuration_Wizard($this->facade, $this->admin, $this->client);
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:18,代碼來源:class-launchkey-wp-configuration-wizard-submit-ajax-callback-test.php

示例8: setUp

 protected function setUp()
 {
     Phake::initAnnotations($this);
     $this->client = new LaunchKey_WP_Native_Client($this->sdk_client, $this->facade, $this->template, $this->language_domain = 'Test Language Domain');
     Phake::when($this->sdk_client)->auth()->thenReturn($this->sdk_auth);
     Phake::when($this->sdk_auth)->authenticate(Phake::anyParameters())->thenReturn($this->auth_request);
     Phake::when($this->template)->render_template(Phake::anyParameters())->thenReturnCallback(function ($template) {
         return 'Rendered: ' . $template;
     });
     Phake::when($this->facade)->__(Phake::anyParameters())->thenReturnCallback(function ($method, $parameters) {
         return sprintf('Translated [%s] with [%s]', $parameters[0], $parameters[1]);
     });
     Phake::when($this->facade)->get_wpdb()->thenReturn($this->wpdb);
     Phake::when($this->facade)->get_user_by(Phake::anyParameters())->thenReturn($this->user);
     $this->user->launchkey_username = null;
     $this->user->ID = 'User ID';
     Phake::when($this->wpdb)->get_var(Phake::anyParameters())->thenReturn('true');
     $this->wpdb->usermeta = 'usermeta_table_name';
     Phake::when($this->facade)->is_debug_log()->thenReturn(false);
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:20,代碼來源:class-launchkey-wp-native-client-test-abstract.php

示例9: setUp

 protected function setUp()
 {
     Phake::initAnnotations($this);
     $this->options = array(LaunchKey_WP_Options::OPTION_SSL_VERIFY => false, LaunchKey_WP_Options::OPTION_ROCKET_KEY => 'Rocket Key', LaunchKey_WP_Options::OPTION_SECRET_KEY => 'Secret Key', LaunchKey_WP_Options::OPTION_REQUEST_TIMEOUT => 'Timeout Value');
     $_COOKIE['launchkey_access_token'] = 'Access Token';
     $_COOKIE['launchkey_refresh_token'] = 'Refresh Token';
     Phake::when($this->facade)->wp_get_current_user()->thenReturn((object) array('data' => (object) array('ID' => 12345, 'user_pass' => 'password')));
     Phake::when($this->facade)->wp_login_url()->thenReturn('LoginURL');
     Phake::when($this->facade)->admin_url(Phake::anyParameters())->thenReturn('AdminURL');
     $that = $this;
     Phake::when($this->facade)->get_option(Phake::anyParameters())->thenReturnCallback(function () use($that) {
         return $that->options;
     });
     Phake::when($this->facade)->wp_remote_post('https://oauth.launchkey.com/resource/ping', $this->anything())->thenReturn(array('body' => '{"message": "invalid"}'));
     Phake::when($this->facade)->wp_remote_post('https://oauth.launchkey.com/access_token', $this->anything())->thenReturn($this->wp_remote_get_response = array('body' => '{"refresh_token": "New Refresh Token", "access_token": "New Access Token", "expires_in": 9999}'));
     Phake::when($this->facade)->current_time(Phake::anyParameters())->thenReturn(1000000);
     $this->client = new LaunchKey_WP_OAuth_Client($this->facade, $this->template, false);
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:18,代碼來源:class-launchkey-wp-oauth-client-admin-callback-access-token-check-test.php

示例10: setUp

 public function setUp()
 {
     Phake::initAnnotations($this);
     $this->freezer = new Phake_Mock_Freezer();
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:5,代碼來源:FreezerTest.php

示例11: setUp

 public function setUp()
 {
     Phake::initAnnotations($this);
     Phake::when($this->machinist)->getStore(Phake::equalTo('default'))->thenReturn($this->store);
 }
開發者ID:derptest,項目名稱:phpmachinist,代碼行數:5,代碼來源:BlueprintTest.php

示例12: setup

 /**
  * Sets up the mock generator
  */
 public function setup()
 {
     Phake::initAnnotations($this);
     $this->mockGenerator = $this->getMock('Phake_ClassGenerator_MockClass');
     $this->facade = new Phake_Facade($this->infoRegistry);
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:9,代碼來源:FacadeTest.php

示例13: setUp

 protected function setUp()
 {
     Phake::initAnnotations($this);
     $this->client = Phake::partialMock('LaunchKey_WP_OAuth_Client', $this->facade, $this->template, false);
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:5,代碼來源:class-launchkey-wp-oauth-client-launchkey-shortcode-test.php

示例14: setUp

 public function setUp()
 {
     Phake::initAnnotations($this);
     $this->handler = new Phake_ClassGenerator_InvocationHandler_CallRecorder($this->callRecorder);
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:5,代碼來源:CallRecorderTest.php

示例15: setUp

 public function setUp()
 {
     Phake::initAnnotations($this);
     $this->matcher = Phake::partialMock('Phake_Matchers_AbstractChainableArgumentMatcher');
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:5,代碼來源:AbstractChainableArgumentMatcherTest.php


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