當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。