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


PHP Argument::withEntry方法代码示例

本文整理汇总了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();
 }
开发者ID:trademachines,项目名称:riemann-client-php,代码行数:7,代码来源:LoggerTest.php

示例2:

 function it_generates_time_inputs($html)
 {
     // Expect
     $html->attributes(Arg::withEntry('type', 'time'));
     // When
     $this->time('time');
 }
开发者ID:mcarral,项目名称:html,代码行数:7,代码来源:FormBuilderSpec.php

示例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);
 }
开发者ID:zeus911,项目名称:PHPCI,代码行数:7,代码来源:BuildLoggerTest.php

示例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);
 }
开发者ID:BenDiouf,项目名称:gallery-bundle,代码行数:7,代码来源:GalleryControllerSpec.php

示例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));
 }
开发者ID:GoogleCloudPlatform,项目名称:gcloud-php,代码行数:7,代码来源:IamTest.php

示例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, []);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:8,代码来源:ProductTypeSpec.php

示例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();
 }
开发者ID:cubicmushroom,项目名称:stripe-bundle,代码行数:8,代码来源:TakePaymentTypeSpec.php

示例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);
 }
开发者ID:cespedosa,项目名称:kreta,代码行数:8,代码来源:IssuePriorityTypeSpec.php

示例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);
 }
开发者ID:cespedosa,项目名称:kreta,代码行数:8,代码来源:StatusTypeSpec.php

示例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, []);
 }
开发者ID:okwinza,项目名称:Sylius,代码行数:8,代码来源:LegacyProductTypeSpec.php

示例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();
 }
开发者ID:GoogleCloudPlatform,项目名称:gcloud-php,代码行数:8,代码来源:DatasetTest.php

示例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);
 }
开发者ID:malukenho,项目名称:Sylius,代码行数:8,代码来源:AddCodeFormSubscriberSpec.php

示例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);
 }
开发者ID:sylius,项目名称:sylius,代码行数:8,代码来源:AddBaseCurrencySubscriberSpec.php

示例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);
 }
开发者ID:yavin,项目名称:symfony-init-controller,代码行数:8,代码来源:InitControllerSubscriberSpec.php

示例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);
 }
开发者ID:lucatume,项目名称:idlikethis,代码行数:13,代码来源:UserContentShortcodeTest.php


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