本文整理汇总了PHP中Phake::capture方法的典型用法代码示例。如果您正苦于以下问题:PHP Phake::capture方法的具体用法?PHP Phake::capture怎么用?PHP Phake::capture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phake
的用法示例。
在下文中一共展示了Phake::capture方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCorrelationDataIsAttached
public function testCorrelationDataIsAttached()
{
CorrelationDataHolder::setCorrelationData(array('correlationId' => 'test'));
$this->testSubject->send(new HelloCommand('Hi !!!'));
\Phake::verify($this->mockCommandBus)->dispatch(\Phake::capture($command), null);
$this->assertEquals(array('correlationId' => 'test'), $command->getMetaData()->all());
}
示例2: 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
示例3: testConsentIsSkippedWhenDisabledPerSp
public function testConsentIsSkippedWhenDisabledPerSp()
{
$this->proxyServerMock->getRepository()->fetchIdentityProviderByEntityId('testIdP')->spsEntityIdsWithoutConsent[] = 'testSp';
$provideConsentService = $this->factoryService();
$provideConsentService->serve(null);
Phake::verify($this->proxyServerMock->getBindingsModule())->send(Phake::capture($message), Phake::capture($metadata));
$this->assertEquals('urn:oasis:names:tc:SAML:2.0:consent:inapplicable', $message->getConsent());
}
示例4: testTranslationHandlersCompilerPass
public function testTranslationHandlersCompilerPass()
{
$containerBuilder = \Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerBuilder');
$bundle = new ModeraTranslationsBundle();
$bundle->build($containerBuilder);
\Phake::verify($containerBuilder)->addCompilerPass(\Phake::capture($pass));
$this->assertInstanceOf('Modera\\TranslationsBundle\\DependencyInjection\\Compiler\\TranslationHandlersCompilerPass', $pass);
}
示例5: testCreateUserTriggersAppropriateWhiteLabelUserCreatedEvent
public function testCreateUserTriggersAppropriateWhiteLabelUserCreatedEvent()
{
$this->whitelabelService->createUser("identifier");
$name = $event = null;
\Phake::verify($this->eventDispatcher)->dispatchEvent(\Phake::capture($name), \Phake::capture($event));
$this->assertEquals("launchkey.whitelabel.user.created", $name, "Unexpected event name");
$this->assertInstanceOf('\\LaunchKey\\SDK\\Event\\WhiteLabelUserCreatedEvent', $event, "Unexpected event type");
$this->assertSame($this->whiteLabelUser, $event->getWhiteLabelUser(), "Unexpected white label user in event");
}
示例6: test_launchkey_logout_sets_connection_close_header
public function test_launchkey_logout_sets_connection_close_header()
{
$_COOKIE['launchkey_access_token'] = 'access token';
$this->client->launchkey_logout();
Phake::verify($this->facade)->wp_remote_get($this->anything(), Phake::capture($options));
$this->assertArrayHasKey('headers', $options);
$this->assertInternalType('array', $options['headers']);
$this->assertEquals($this->options[LaunchKey_WP_Options::OPTION_REQUEST_TIMEOUT], $options['timeout']);
}
开发者ID:ThemeSurgeon,项目名称:launchkey-wordpress,代码行数:9,代码来源:class-launchkey-wp-oauth-client-launchkey-logout-test.php
示例7: testProcess
public function testProcess()
{
$routingLoaderWannaBe = \Phake::mock('Symfony\\Component\\DependencyInjection\\Definition');
$containerBuilder = \Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerBuilder');
\Phake::when($containerBuilder)->getDefinition('routing.loader')->thenReturn($routingLoaderWannaBe);
$cp = new DelegatingLoaderCloningCompilerPass();
$cp->process($containerBuilder);
\Phake::verify($containerBuilder)->setDefinition('modera_routing.symfony_delegating_loader', \Phake::capture($clonedDefinition));
$this->assertInstanceOf(get_class($routingLoaderWannaBe), $clonedDefinition);
}
示例8: testContributorIsInjected
public function testContributorIsInjected()
{
$containerBuilder = \Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerBuilder');
$bundle = new ModeraBackendDashboardBundle($containerBuilder);
$bundle->build($containerBuilder);
\Phake::verify($containerBuilder)->addCompilerPass(\Phake::capture($pass));
$this->assertInstanceOf('Sli\\ExpanderBundle\\DependencyInjection\\CompositeContributorsProviderCompilerPass', $pass);
/* @var CompositeContributorsProviderCompilerPass $pass */
$this->assertEquals('modera_backend_dashboard.dashboard_provider', $pass->getProviderServiceId());
$this->assertEquals('modera_backend_dashboard.dashboard_provider', $pass->getContributorServiceTagName());
}
示例9: testMakeWithMultiLevelDefaultsMergesOverridesData
public function testMakeWithMultiLevelDefaultsMergesOverridesData()
{
$bp = new Blueprint($this->machinist, 'test_table', array('doc' => array('a' => 'aye', 'c' => 'see')));
Phake::when($this->store)->find(Phake::anyParameters())->thenReturn(array(new stdClass()));
Phake::when($this->store)->columns(Phake::anyParameters())->thenReturn(array('doc'));
$bp->make(array('doc' => array('a' => 'new aye', 'b' => 'bee')));
$expected = array('doc' => array('a' => 'new aye', 'b' => 'bee', 'c' => 'see'));
$actual = null;
Phake::verify($this->store)->insert('test_table', Phake::capture($actual));
$this->assertEquals($expected, $actual);
}
示例10: test_create_admin_page_echos_form_correctly
public function test_create_admin_page_echos_form_correctly()
{
$this->options[LaunchKey_WP_Options::OPTION_IMPLEMENTATION_TYPE] = LaunchKey_WP_Implementation_Type::NATIVE;
$this->options[LaunchKey_WP_Options::OPTION_ROCKET_KEY] = 'Expected Rocket Key';
$this->options[LaunchKey_WP_Options::OPTION_APP_DISPLAY_NAME] = 'Expected App Display Name';
$this->options[LaunchKey_WP_Options::OPTION_SSL_VERIFY] = true;
$expected_context = array('rocket_key' => 'Expected Rocket Key', 'app_display_name' => 'Expected App Display Name', 'callback_url' => sprintf('AdminURL [admin-ajax.php?action=%s]', LaunchKey_WP_Native_Client::CALLBACK_AJAX_ACTION), 'sso_post_url' => 'LoginURL [ROOT]', 'ssl_verify_checked' => 'checked="checked"', 'domain' => 'Parsed URL', 'mcrypt_pass_fail' => 'fail', 'openssl_pass_fail' => 'fail', 'curl_pass_fail' => 'fail', 'dom_pass_fail' => 'fail', 'show_sso_next' => 'hide', 'show_sso_back' => 'show', 'wp_username' => 'login', 'sso_entity_id' => null, 'sso_public_key' => null, 'sso_login_url' => null, 'sso_logout_url' => null, 'sso_error_url' => null, 'settings-sso-visible' => 'hide', 'settings-standard-visible' => null);
$this->admin->create_launchkey_settings_page();
Phake::verify($this->template)->render_template('admin/settings', Phake::capture($actual_context));
Phake::verify($this->facade)->_echo('Rendered [admin/settings]');
$this->assertEquals($expected_context, $actual_context);
}
示例11: testOnKernelException
public function testOnKernelException()
{
$event = $this->createMockEvent(true, '/mega-backend', new AccessDeniedException());
$lnr = new AjaxAuthenticationValidatingListener('/mega-backend');
$lnr->onKernelException($event);
\Phake::verify($event, \Phake::times(2))->getRequest();
\Phake::verify($event)->getException();
\Phake::verify($event)->setResponse(\Phake::capture($response));
\Phake::verifyNoOtherInteractions($event);
/* @var JsonResponse $response */
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\JsonResponse', $response);
$content = json_decode($response->getContent(), true);
$this->assertTrue(is_array($content));
$this->assertArrayHasKey('success', $content);
$this->assertFalse($content['success']);
$this->assertArrayHasKey('message', $content);
$this->assertTrue('' != $content['message']);
}
示例12: test_headers_are_passed_to_request
public function test_headers_are_passed_to_request()
{
$_SERVER['HTTP_MY_HEADER'] = 'Expected Header Value';
$this->client->launchkey_callback();
Phake::verify($this->sdk_sse)->handleEvent(Phake::capture($request), $this->anything());
$this->assertEquals(array('Expected Header Value'), $request->getHeader('my-header'));
}
开发者ID:aenglander,项目名称:launchkey-wordpress,代码行数:7,代码来源:class-launchkey-wp-native-client-callback-handler-test.php
示例13: test_deorbit_callback_searches_for_user_by_user_hash
public function test_deorbit_callback_searches_for_user_by_user_hash()
{
Phake::when($this->deorbit_callback)->getUserHash()->thenReturn('User hash');
Phake::when($this->sdk_auth)->handleCallback(Phake::anyParameters())->thenReturn($this->deorbit_callback);
$this->client->launchkey_callback();
Phake::verify($this->facade)->get_users(Phake::capture($actual));
$this->assertEquals(array('meta_key' => 'launchkey_user', 'meta_value' => 'User hash'), $actual);
}
开发者ID:ThemeSurgeon,项目名称:launchkey-wordpress,代码行数:8,代码来源:class-launchkey-wp-native-client-callback-handler-test.php
示例14: testArgumentCapturingWorksOnStubbing
/**
* Make sure arguments are captured with no issues
*/
public function testArgumentCapturingWorksOnStubbing()
{
$mock = Phake::mock('PhakeTest_MockedClass');
$obj = new stdClass();
Phake::when($mock)->fooWithArgument(Phake::capture($toArgument))->thenReturn(true);
$mock->fooWithArgument($obj);
$this->assertSame($obj, $toArgument);
}
示例15: array
public function test_when_launchkey_meta_data_and_no_password_paired_without_password_template_shown_with_the_correct_context()
{
$this->user->ID = 1;
$this->user->user_pass = null;
$this->client->launchkey_personal_options($this->user);
Phake::verify($this->template)->render_template('personal-options/paired-without-password', Phake::capture($actual_context));
Phake::verify($this->facade)->_echo('Rendered [personal-options/paired-without-password]');
$expected_context = array('app_display_name' => 'App Display Name');
$this->assertEquals($expected_context, $actual_context);
}