本文整理汇总了PHP中Prophecy\Argument::withEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP Argument::withEntry方法的具体用法?PHP Argument::withEntry怎么用?PHP Argument::withEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prophecy\Argument
的用法示例。
在下文中一共展示了Argument::withEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testReformatAttributes
public function testReformatAttributes()
{
$client = $this->getRiemannClient();
$logger = new Logger($client->reveal());
$logger->log([], ['foo' => 'bar']);
$client->sendEvent(Argument::withEntry('attributes', [['key' => 'foo', 'value' => 'bar']]))->shouldHaveBeenCalled();
}
示例2:
function it_generates_time_inputs($html)
{
// Expect
$html->attributes(Arg::withEntry('type', 'time'));
// When
$this->time('time');
}
示例3: testLogFailure_AddsExceptionContext
public function testLogFailure_AddsExceptionContext()
{
$message = "Testing";
$exception = new \Exception("Expected Exception");
$this->mockLogger->log(Argument::type('string'), Argument::type('string'), Argument::withEntry('exception', $exception))->shouldBeCalledTimes(1);
$this->testedBuildLogger->logFailure($message, $exception);
}
示例4:
function it_render_template_with_paginator(EngineInterface $templating, Response $response, GalleryManagerInterface $galleryManager, AdapterInterface $adapter)
{
$galleryManager->createPagerfantaAdapter()->willReturn($adapter);
$adapter->getNbResults()->willReturn(5);
$templating->renderResponse('FSiGalleryBundle:Gallery:list.html.twig', Argument::allOf(Argument::withEntry('galleries', Argument::type('Pagerfanta\\Pagerfanta')), Argument::withEntry('preview_photos_count', 4)))->willReturn($response);
$this->listAction(2)->shouldReturn($response);
}
示例5: testTestPermissions
public function testTestPermissions()
{
$permissions = ['foo', 'bar'];
$this->connection->testPermissions(Argument::withEntry('permissions', $permissions))->willReturn($permissions);
$iam = new Iam($this->connection->reveal(), self::RESOURCE);
$this->assertEquals($permissions, $iam->testPermissions($permissions));
}
示例6:
function it_builds_form_with_proper_fields(FormBuilder $builder)
{
$builder->add('masterVariant', 'sylius_product_variant', Argument::any())->shouldBeCalled()->willReturn($builder);
$builder->add('attributes', 'collection', Argument::any())->shouldBeCalled()->willReturn($builder);
$builder->add('options', 'sylius_product_option_choice', Argument::any())->shouldBeCalled()->willReturn($builder);
$builder->add('associations', 'collection', Argument::withEntry('type', 'sylius_product_association'))->shouldBeCalled()->willReturn($builder);
$this->buildForm($builder, []);
}
示例7:
function it_should_use_the_take_payment_command_data_class(OptionsResolver $resolver)
{
/** @noinspection PhpUndefinedMethodInspection */
$this->setDefaultOptions($resolver);
/** @noinspection PhpParamsInspection */
/** @noinspection PhpUndefinedMethodInspection */
$resolver->setDefaults(Argument::withEntry('data_class', TakePaymentCommand::class))->shouldHaveBeenCalled();
}
示例8:
function it_sets_default_options(OptionsResolver $resolver)
{
$resolver->setDefaults(Argument::withEntry('data_class', 'Kreta\\Component\\Project\\Model\\IssuePriority'))->shouldBeCalled()->willReturn($resolver);
$resolver->setDefaults(Argument::withEntry('csrf_protection', false))->shouldBeCalled()->willReturn($resolver);
$resolver->setDefaults(Argument::withEntry('empty_data', Argument::type('closure')))->shouldBeCalled()->willReturn($resolver);
$resolver->setRequired(['project'])->shouldBeCalled()->willReturn($resolver);
$this->configureOptions($resolver);
}
示例9:
function it_sets_default_options(OptionsResolver $resolver)
{
$resolver->setDefaults(Argument::withEntry('data_class', 'Kreta\\Component\\Workflow\\Model\\Status'))->shouldBeCalled()->willReturn($resolver);
$resolver->setDefaults(Argument::withEntry('csrf_protection', false))->shouldBeCalled()->willReturn($resolver);
$resolver->setDefaults(Argument::withEntry('empty_data', Argument::type('closure')))->shouldBeCalled()->willReturn($resolver);
$resolver->setOptional(['workflow'])->shouldBeCalled()->willReturn($resolver);
$this->configureOptions($resolver);
}
示例10:
function it_builds_form_with_proper_fields(FormBuilder $builder)
{
$builder->add('attributes', 'collection', Argument::any())->shouldBeCalled()->willReturn($builder);
$builder->add('options', 'sylius_product_option_choice', Argument::any())->shouldBeCalled()->willReturn($builder);
$builder->addEventSubscriber(Argument::type(AddCodeFormSubscriber::class))->shouldBeCalled()->willReturn($builder);
$builder->add('associations', 'collection', Argument::withEntry('type', 'sylius_product_association'))->shouldBeCalled()->willReturn($builder);
$this->buildForm($builder, []);
}
示例11: testUpdate
public function testUpdate()
{
$this->connection->patchDataset(Argument::withEntry('friendlyName', 'A fanciful dataset.'))->shouldBeCalledTimes(1)->willReturn([]);
$dataset = $this->getDataset($this->connection);
$snippet = $this->snippetFromMethod(Dataset::class, 'update');
$snippet->addLocal('dataset', $dataset);
$snippet->invoke();
}
示例12:
function it_adds_code_with_type_text_by_default(FormEvent $event, FormInterface $form, CodeAwareInterface $resource)
{
$event->getData()->willReturn($resource);
$event->getForm()->willReturn($form);
$resource->getCode()->willReturn('Code12');
$form->add('code', 'text', Argument::withEntry('disabled', true))->shouldBeCalled();
$this->preSetData($event);
}
示例13:
function it_does_not_set_base_currency_as_enabled_when_channel_is_new(FormEvent $event, ChannelInterface $channel, FormInterface $form)
{
$event->getData()->willReturn($channel);
$event->getForm()->willReturn($form);
$channel->getId()->willReturn(null);
$form->add('baseCurrency', Argument::type('string'), Argument::withEntry('disabled', false))->shouldBeCalled();
$this->preSetData($event);
}
示例14: it_set_controller_if_init_return_response
public function it_set_controller_if_init_return_response(FilterControllerEvent $event, Request $request, SampleInitController $controller)
{
$event->getRequest()->willReturn($request);
$event->getController()->willReturn(array($controller));
$controller->init($request)->willReturn(new Response('http://example.com/'));
$event->setController(Argument::allOf(Argument::withEntry('0', Argument::type('Yavin\\Symfony\\Controller\\InitControllerSubscriber')), Argument::withEntry('1', 'responseAction')))->shouldBeCalled();
$this->onKernelController($event);
}
示例15: it_should_return_the_escaped_content_if_provided
/**
* @test
* it should return the escaped content if provided
*/
public function it_should_return_the_escaped_content_if_provided()
{
$sut = $this->make_instance();
$this->context->get_post_id()->willReturn(23);
$this->context->get_comment_text()->willReturn('default text');
$content = 'some&content$$<>';
$this->render_engine->render(Argument::any(), Argument::withEntry('comment_text', esc_attr($content)))->shouldBeCalled();
$out = $sut->render([], $content);
}