当前位置: 首页>>代码示例>>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;未经允许,请勿转载。