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


PHP Phake::never方法代碼示例

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


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

示例1: testFindInTrans

 public function testFindInTrans()
 {
     $this->target->begin();
     $this->target->find('hoge', 'ssd', array('a', 'b', 3), 'fuga');
     \Phake::verify($this->write)->find('hoge', 'ssd', array('a', 'b', 3), 'fuga');
     \Phake::verify($this->read, \Phake::never())->find('hoge', 'ssd', array('a', 'b', 3), 'fuga');
 }
開發者ID:aainc,項目名稱:Mahotora,代碼行數:7,代碼來源:MultiDatabaseSessionTest.php

示例2: test_does_not_update_option_when_check_option_returns_errors

 public function test_does_not_update_option_when_check_option_returns_errors()
 {
     $_POST['nonce'] = 'not empty';
     Phake::when($this->admin)->check_option(Phake::anyParameters())->thenReturn(array(array(), array('error')));
     $this->wizard->wizard_submit_ajax();
     Phake::verify($this->facade, Phake::never())->update_option(Phake::anyParameters());
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:7,代碼來源:class-launchkey-wp-configuration-wizard-submit-ajax-callback-test.php

示例3: test_enqueue_verifier_native_script_does_not_enqueue_script_if_user_cannot_manage_options

 public function test_enqueue_verifier_native_script_does_not_enqueue_script_if_user_cannot_manage_options()
 {
     Phake::when($this->facade)->current_user_can('manage_options')->thenReturn(false);
     $this->wizard->enqueue_verify_configuration_script();
     Phake::verify($this->facade)->current_user_can('manage_options');
     Phake::verify($this->facade, Phake::never())->wp_enqueue_script(Phake::anyParameters());
 }
開發者ID:anthony-dandrea,項目名稱:launchkey-wordpress,代碼行數:7,代碼來源:class-launchkey-wp-configuration-wizard-test.php

示例4: test_when_authenticate_throws_exception_it_does_not_log_when_not_debug

 public function test_when_authenticate_throws_exception_it_does_not_log_when_not_debug()
 {
     Phake::when($this->facade)->is_debug_log()->thenReturn(false);
     Phake::when($this->sdk_auth)->authenticate(Phake::anyParameters())->thenThrow(new Exception());
     $this->client->launchkey_user_authentication('user', 'username');
     Phake::verify($this->facade, Phake::never())->error_log(Phake::anyParameters());
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:7,代碼來源:class-launchkey-wp-native-client-authenticate-user-test.php

示例5: testExecuteNoResultNoParameter

 public function testExecuteNoResultNoParameter()
 {
     \Phake::when($this->target)->getAffectedRows()->thenReturn(0);
     \Phake::when($this->connection)->prepare('DROP TABLE')->thenReturn($this->statement);
     $this->target->executeNoResult('DROP TABLE');
     \Phake::verify($this->statement, \Phake::never())->bind_param(\Phake::anyParameters());
     \Phake::verify($this->statement)->close();
 }
開發者ID:aainc,項目名稱:Mahotora,代碼行數:8,代碼來源:DatabaseSessionTest.php

示例6: test_does_not_logoout_or_redirect_if_user_authed_with_launchkey_and_still_authenticated

 /**
  * @depends test_gets_the_current_user_and_checks_their_status
  */
 public function test_does_not_logoout_or_redirect_if_user_authed_with_launchkey_and_still_authenticated()
 {
     Phake::when($this->facade)->is_user_logged_in()->thenReturn(true);
     Phake::when($this->wpdb)->get_var(Phake::anyParameters())->thenReturn('true');
     $this->client->launchkey_still_authenticated_heartbeat();
     Phake::verify($this->facade, Phake::never())->update_user_meta(Phake::anyParameters());
     Phake::verify($this->facade, Phake::never())->wp_logout(Phake::anyParameters());
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:11,代碼來源:class-launchkey-wp-native-client-still-authenticated-heartbeat-test.php

示例7: test_exceptions_do_not_log_when_not_debug

 public function test_exceptions_do_not_log_when_not_debug()
 {
     $this->user->launchkey_auth = 'auth_request_id';
     Phake::when($this->facade)->is_debug_log()->thenReturn(false);
     Phake::when($this->sdk_auth)->deOrbit(Phake::anyParameters())->thenThrow(new Exception());
     $this->client->logout();
     Phake::verify($this->facade, Phake::never())->error_log(Phake::anyParameters());
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:8,代碼來源:class-launchkey-wp-native-client-logout-test.php

示例8:

 public function test_non_login_with_loggedin_user_that_is_paired_and_was_authorized_by_launchkey_does_nothing_when_authenticated_is_true()
 {
     Phake::when($this->facade)->wp_get_current_user(Phake::anyParameters())->thenReturn($this->user);
     $this->user->launchkey_username = 'launchkey username';
     $this->user->launchkey_authorized = 'true';
     $this->client->authentication_controller(null, null, null);
     Phake::verify($this->facade, Phake::never())->remove_all_filters(Phake::anyParameters());
     Phake::verify($this->facade, Phake::never())->add_filter(Phake::anyParameters());
     Phake::verify($this->facade, Phake::never())->wp_logout(Phake::anyParameters());
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:10,代碼來源:class-launchkey-wp-native-client-authentication-controller-test.php

示例9: test_does_not_update_user_meta_on_authorize_exception

 public function test_does_not_update_user_meta_on_authorize_exception()
 {
     $_SERVER['REQUEST_METHOD'] = 'POST';
     $_POST['username'] = 'expected';
     $_REQUEST['nonce'] = 'not empty';
     Phake::when($this->auth)->authorize(Phake::anyParameters())->thenThrow(new Exception());
     $this->wizard->verify_configuration_callback();
     Phake::verify($this->facade, Phake::never())->update_user_meta(Phake::anyParameters());
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:9,代碼來源:class-launchkey-wp-configuration-wizard-verify-configuration-callback-test.php

示例10: testShouldNotBindEventListenerWhenJsonFormatOptionIsFalse

 public function testShouldNotBindEventListenerWhenJsonFormatOptionIsFalse()
 {
     $builder = \Phake::mock('Symfony\\Component\\Form\\FormBuilderInterface');
     $this->formTypeJsonExtension->buildForm($builder, ['json_format' => false]);
     \Phake::verify($builder, \Phake::never())->addEventSubscriber(new JsonExtensionListener());
 }
開發者ID:LinkValue,項目名稱:JsonFormExtension-dev,代碼行數:6,代碼來源:FormTypeJsonExtensionTest.php

示例11: test_register_actions_does_not_register_admin_actions_when_not_admin

 /**
  * @dataProvider provider_admin_actions
  *
  * @param $action
  * @param $callback
  */
 public function test_register_actions_does_not_register_admin_actions_when_not_admin($action, $callback)
 {
     Phake::when($this->facade)->is_admin()->thenReturn(false);
     $this->client->register_actions();
     Phake::verify($this->facade, Phake::never())->add_action($action, array($this->client, $callback));
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:12,代碼來源:class-launchkey-wp-native-client-test.php

示例12: test_launchkey_admin_callback_admin_pair_does_nothing_when_launchkey_user_cookie_is_set_but_not_valid

 public function test_launchkey_admin_callback_admin_pair_does_nothing_when_launchkey_user_cookie_is_set_but_not_valid()
 {
     $_GET['launchkey_admin_pair'] = '1';
     $_COOKIE['launchkey_user'] = '123456789';
     $this->client->launchkey_admin_callback();
     Phake::verify($this->facade, Phake::never())->update_user_meta(Phake::anyParameters());
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:7,代碼來源:class-launchkey-wp-oauth-client-admin-callback-access-token-check-test.php

示例13: test_launchkey_logout_without_access_token_cookie_does_not_set_cookie

 public function test_launchkey_logout_without_access_token_cookie_does_not_set_cookie()
 {
     $this->client->launchkey_logout();
     Phake::verify($this->facade, Phake::never())->setcookie(Phake::anyParameters());
 }
開發者ID:ThemeSurgeon,項目名稱:launchkey-wordpress,代碼行數:5,代碼來源:class-launchkey-wp-oauth-client-launchkey-logout-test.php

示例14: test_auth_response_callback_does_not_set_launchkey_username_for_non_native_implementations

 /**
  * @dataProvider provider_non_native_implementations
  *
  * @param $type
  */
 public function test_auth_response_callback_does_not_set_launchkey_username_for_non_native_implementations($type)
 {
     Phake::when($this->facade)->get_option(Phake::anyParameters())->thenReturn(array(LaunchKey_WP_Options::OPTION_IMPLEMENTATION_TYPE => $type));
     Phake::when($this->sdk_sse)->handleEvent(Phake::anyParameters())->thenReturn($this->auth_response);
     Phake::when($this->auth_response)->getUserPushId()->thenReturn($expected = 'Expceted User Push ID');
     $this->client->launchkey_callback();
     Phake::verify($this->facade, Phake::never())->update_user_meta($this->user->ID, 'launchkey_username', $this->anything());
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:13,代碼來源:class-launchkey-wp-native-client-callback-handler-test.php

示例15: test_remove_password_handler_without_verified_nonce_does_not_remove_password

 public function test_remove_password_handler_without_verified_nonce_does_not_remove_password()
 {
     $_GET['launchkey_remove_password'] = '1';
     $_GET['launchkey_nonce'] = 'nonce value';
     $this->client->remove_password_handler();
     Phake::verify($this->facade)->wp_verify_nonce('nonce value', LaunchKey_WP_User_Profile::NONCE_KEY);
     Phake::verify($this->facade, Phake::never())->wp_update_user(Phake::anyParameters());
 }
開發者ID:aenglander,項目名稱:launchkey-wordpress,代碼行數:8,代碼來源:class-launchkey-wp-user-profile-test.php


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