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