当前位置: 首页>>代码示例>>PHP>>正文


PHP Phake::inOrder方法代码示例

本文整理汇总了PHP中Phake::inOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP Phake::inOrder方法的具体用法?PHP Phake::inOrder怎么用?PHP Phake::inOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phake的用法示例。


在下文中一共展示了Phake::inOrder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_launchkey_sso_session_redirects_to_logout_url_and_exits

 public function test_launchkey_sso_session_redirects_to_logout_url_and_exits()
 {
     $this->user->launchkey_sso_session = "Not Null";
     $this->client->logout();
     Phake::inOrder(Phake::verify($this->facade)->wp_redirect(static::LOGOUT_URL), Phake::verify($this->facade)->_exit(Phake::anyParameters()));
     Phake::verifyNoFurtherInteraction($this->facade);
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:7,代码来源:class-launchkey-wp-sso-client-logout-test.php

示例2: test_username_login_removes_all_authentication_filters_and_then_adds_the_launchkey_filter

 public function test_username_login_removes_all_authentication_filters_and_then_adds_the_launchkey_filter()
 {
     Phake::when($this->facade)->get_user_by(Phake::anyParameters())->thenReturn($this->user);
     $this->user->launchkey_username = 'launchkey username';
     $this->client->authentication_controller(null, 'username', null);
     Phake::inOrder(Phake::verify($this->facade)->remove_all_filters('authenticate'), Phake::verify($this->facade)->add_filter('authenticate', array($this->client, 'null_method')), Phake::verify($this->facade)->add_filter('authenticate', array($this->client, 'launchkey_user_authentication'), 30, 2));
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:7,代码来源:class-launchkey-wp-native-client-authentication-controller-test.php

示例3: test_gets_the_current_user_and_checks_their_status

 public function test_gets_the_current_user_and_checks_their_status()
 {
     Phake::when($this->wpdb)->prepare(Phake::anyParameters())->thenReturn('PREPARED QUERY');
     $this->client->launchkey_still_authenticated_page_load();
     Phake::inOrder(Phake::verify($this->wpdb)->prepare(Phake::capture($query), $this->user->ID), Phake::verify($this->wpdb)->get_var('PREPARED QUERY'));
     $this->assertEquals($query, "SELECT meta_value FROM {$this->wpdb->usermeta} WHERE user_id = %s AND meta_key = 'launchkey_authorized' LIMIT 1");
 }
开发者ID:ThemeSurgeon,项目名称:launchkey-wordpress,代码行数:7,代码来源:class-launchkey-wp-native-client-still-authenticated-heartbeat-test.php

示例4: test_register_actions_adds_filter_for_plugin_action_links

 public function test_register_actions_adds_filter_for_plugin_action_links()
 {
     Phake::when($this->facade)->plugin_basename(Phake::anyParameters())->thenReturn('BASENAME');
     Phake::when($this->facade)->plugin_dir_path(Phake::anyParameters())->thenReturn('DIRPATH');
     $this->admin->register_actions();
     $reflection_class = new ReflectionClass('LaunchKey_WP_Admin');
     Phake::inOrder(Phake::verify($this->facade)->plugin_dir_path(dirname($reflection_class->getFileName())), Phake::verify($this->facade)->plugin_basename('DIRPATH' . 'launchkey.php'), Phake::verify($this->facade)->add_filter('plugin_action_links_BASENAME', array($this->admin, 'add_action_links')));
 }
开发者ID:ThemeSurgeon,项目名称:launchkey-wordpress,代码行数:8,代码来源:class-launchkey-wp-admin-test.php

示例5: test_logs_out_user_and_redirects_if_user_authed_with_launchkey_and_no_longer_authenticated

 /**
  * @depends test_gets_the_current_user_and_checks_their_status
  */
 public function test_logs_out_user_and_redirects_if_user_authed_with_launchkey_and_no_longer_authenticated()
 {
     Phake::when($this->facade)->is_user_logged_in()->thenReturn(true);
     Phake::when($this->wpdb)->get_var(Phake::anyParameters())->thenReturn('false');
     Phake::when($this->facade)->wp_login_url()->thenReturn('Login URL');
     $this->client->launchkey_still_authenticated_page_load();
     Phake::verify($this->facade)->update_user_meta($this->user->ID, 'launchkey_sso_session', null);
     Phake::verify($this->facade)->update_user_meta($this->user->ID, 'launchkey_authorized', null);
     Phake::verify($this->facade)->wp_logout();
     Phake::inOrder(Phake::verify($this->facade)->wp_redirect('Login URL'), Phake::verify($this->facade)->_exit());
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:14,代码来源:class-launchkey-wp-sso-client-still-authenticated-page-load-test.php

示例6: testUpload

 public function testUpload()
 {
     $gateway = \Phake::mock('Modera\\FileUploaderBundle\\Uploading\\UploadGatewayInterface');
     $provider = \Phake::mock(ContributorInterface::CLAZZ);
     \Phake::when($provider)->getItems()->thenReturn(array($gateway));
     $request = \Phake::mock('Symfony\\Component\\HttpFoundation\\Request');
     \Phake::when($gateway)->isResponsible($request)->thenReturn(true);
     \Phake::when($gateway)->upload($request)->thenReturn('foobar');
     $wu = new WebUploader($provider);
     $result = $wu->upload($request);
     \Phake::inOrder(\Phake::verify($provider)->getItems(), \Phake::verify($gateway)->isResponsible($request), \Phake::verify($gateway)->upload($request));
     $this->assertEquals('foobar', $result);
 }
开发者ID:modera,项目名称:foundation,代码行数:13,代码来源:WebUploaderTest.php

示例7: testMagicCallMethodChecksForImplicitStubFirst

 public function testMagicCallMethodChecksForImplicitStubFirst()
 {
     $ref = array('foo', array('bar'));
     Phake::when($this->stubMapper)->getStubByCall(Phake::anyParameters())->thenReturn(null);
     $this->handler->invoke($this->mock, '__call', $ref, $ref);
     Phake::inOrder(Phake::verify($this->stubMapper)->getStubByCall('foo', array('bar')), Phake::verify($this->stubMapper)->getStubByCall('__call', array('foo', array('bar'))));
 }
开发者ID:ngyuki,项目名称:phake,代码行数:7,代码来源:StubCallerTest.php

示例8:

 public function test_when_token_invalid_and_refresh_token_exists_and_refresh_returns_no_access_token__user_is_logged_out_and_redirected()
 {
     Phake::when($this->facade)->wp_remote_post('https://oauth.launchkey.com/access_token', $this->anything())->thenReturn(array('body' => '{"refresh_token": "New Refresh Token", "expires_in": 9999}'));
     $this->client->launchkey_admin_callback();
     Phake::verify($this->facade)->wp_login_url();
     Phake::inOrder(Phake::verify($this->facade)->wp_logout(), Phake::verify($this->facade)->wp_redirect('LoginURL?loggedout=1'));
     Phake::verifyNoFurtherInteraction($this->facade);
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:8,代码来源:class-launchkey-wp-oauth-client-admin-callback-access-token-check-test.php

示例9: test_session_index_already_registered_redirects_to_error_url_and_exits

 public function test_session_index_already_registered_redirects_to_error_url_and_exits()
 {
     Phake::when($this->saml_response_service)->is_session_index_registered()->thenReturn(true);
     $this->client->authenticate(null, null, null);
     Phake::inOrder(Phake::verify($this->saml_response_service)->is_session_index_registered(), Phake::verify($this->facade)->wp_redirect(static::ERROR_URL), Phake::verify($this->facade)->_exit(Phake::anyParameters()));
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:6,代码来源:class-launchkey-wp-sso-client-authenticate-test.php

示例10: test_is_session_index_registered_makes_proper_query_against_database

 public function test_is_session_index_registered_makes_proper_query_against_database()
 {
     $this->service->is_session_index_registered();
     Phake::inOrder(Phake::verify($this->wpdb)->prepare("SELECT COUNT(*) FROM prefix_launchkey_sso_sessions WHERE id = %s", "id-b4373c87a6f18f97862c931744fd799f"), Phake::verify($this->wpdb)->get_var(static::PREPARED_STARTEMENT));
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:5,代码来源:class-launchkey-wp-saml2-response-service-test.php

示例11: test_unpair_handler_with_verified_nonce_unpairs_current_user_if_user_has_password

 public function test_unpair_handler_with_verified_nonce_unpairs_current_user_if_user_has_password()
 {
     $_GET['launchkey_unpair'] = '1';
     $_GET['launchkey_nonce'] = 'nonce value';
     Phake::when($this->facade)->wp_verify_nonce(Phake::anyParameters())->thenReturn(true);
     $this->client->unpair_handler();
     Phake::verify($this->facade)->wp_get_current_user();
     Phake::inOrder(Phake::verify($this->facade)->wp_verify_nonce('nonce value', LaunchKey_WP_User_Profile::NONCE_KEY), Phake::verify($this->facade)->delete_user_meta(12345, 'launchkey_user'));
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:9,代码来源:class-launchkey-wp-user-profile-test.php

示例12: test_enqueue_wizard_script_localizes_script_before_enqueueing

 public function test_enqueue_wizard_script_localizes_script_before_enqueueing()
 {
     $this->wizard->enqueue_wizard_script();
     Phake::inOrder(Phake::verify($this->facade)->wp_enqueue_script(Phake::anyParameters()), Phake::verify($this->facade)->wp_localize_script(Phake::anyParameters()));
 }
开发者ID:anthony-dandrea,项目名称:launchkey-wordpress,代码行数:5,代码来源:class-launchkey-wp-configuration-wizard-test.php

示例13: test_dies_with_invalid_request_when_timestamp_not_within_restrictions

 public function test_dies_with_invalid_request_when_timestamp_not_within_restrictions()
 {
     Phake::when($this->saml_request_service)->is_timestamp_within_restrictions(Phake::anyParameters())->thenReturn(false);
     $this->client->authenticate(null, null, null);
     Phake::inOrder(Phake::verify($this->saml_request_service)->is_timestamp_within_restrictions(static::NOW), Phake::verify($this->facade)->wp_die('Invalid Request', 400));
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:6,代码来源:class-launchkey-wp-sso-client-deorbit-test.php

示例14: test_enqueue_wizard_script_localizes_script_after_enqueueing_scripts

 public function test_enqueue_wizard_script_localizes_script_after_enqueueing_scripts()
 {
     $this->wizard->enqueue_scripts();
     Phake::inOrder(Phake::verify($this->facade, Phake::atLeast(1))->wp_enqueue_script(Phake::anyParameters()), Phake::verify($this->facade)->wp_localize_script(Phake::anyParameters()));
 }
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:5,代码来源:class-launchkey-wp-configuration-wizard-test.php

示例15: testUnitOfWorkCleanupDelayedUntilOuterUnitOfWorkIsCleanedUp_InnerCommit_OuterRollback

 public function testUnitOfWorkCleanupDelayedUntilOuterUnitOfWorkIsCleanedUp_InnerCommit_OuterRollback()
 {
     $outerListener = \Phake::mock(UnitOfWorkListenerInterface::class);
     $innerListener = \Phake::mock(UnitOfWorkListenerInterface::class);
     $outer = DefaultUnitOfWork::startAndGet();
     $inner = DefaultUnitOfWork::startAndGet();
     $inner->registerListener($innerListener);
     $outer->registerListener($outerListener);
     $inner->commit();
     \Phake::verify($innerListener, \Phake::never())->afterCommit(\Phake::anyParameters());
     \Phake::verify($innerListener, \Phake::never())->onCleanup(\Phake::anyParameters());
     $outer->rollback();
     \Phake::verify($outerListener, \Phake::never())->onPrepareCommit(\Phake::anyParameters());
     \Phake::inOrder(\Phake::verify($innerListener)->onPrepareCommit(\Phake::anyParameters()), \Phake::verify($innerListener)->onRollback(\Phake::anyParameters()), \Phake::verify($outerListener)->onRollback(\Phake::anyParameters()), \Phake::verify($innerListener)->onCleanup(\Phake::anyParameters()), \Phake::verify($outerListener)->onCleanup(\Phake::anyParameters()));
 }
开发者ID:fcm,项目名称:GovernorFramework,代码行数:15,代码来源:DefaultUnitOfWorkTest.php


注:本文中的Phake::inOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。