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


PHP Argument::type方法代码示例

本文整理汇总了PHP中Prophecy\Argument::type方法的典型用法代码示例。如果您正苦于以下问题:PHP Argument::type方法的具体用法?PHP Argument::type怎么用?PHP Argument::type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Prophecy\Argument的用法示例。


在下文中一共展示了Argument::type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: let

 function let(ObjectManager $om, ObjectRepository $or)
 {
     // It is not possible to mock internal classes with final constructor
     $this->beConstructedWith(new \SimpleXMLElement('<row></row>'), $om);
     $om->getRepository(Argument::type('string'))->willReturn($or);
     $or->findOneBy(Argument::type('array'))->willReturn();
 }
开发者ID:jacdobro,项目名称:teryt-database-bundle,代码行数:7,代码来源:StreetsNodeConverterSpec.php

示例2:

 function it_builds_form_with_proper_fields(FormBuilder $builder)
 {
     $builder->add('name', 'text', Argument::any())->shouldBeCalled()->willReturn($builder);
     $builder->add('abbreviation', 'text', Argument::any())->shouldBeCalled()->willReturn($builder);
     $builder->addEventSubscriber(Argument::type(AddCodeFormSubscriber::class))->shouldBeCalled()->willReturn($builder);
     $this->buildForm($builder, []);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:7,代码来源:ProvinceTypeSpec.php

示例3:

 function it_marks_a_variant_group_as_updated_when_its_attributes_are_removed_or_updated($registry, EntityManager $em, ProductTemplateInterface $productTemplate, GroupInterface $group, GroupRepositoryInterface $groupRepo)
 {
     $productTemplate->getId()->willReturn(956);
     $registry->getRepository(Argument::type('string'))->willReturn($groupRepo);
     $groupRepo->getVariantGroupByProductTemplate($productTemplate)->willReturn($group);
     $this->guessUpdates($em, $productTemplate, UpdateGuesserInterface::ACTION_UPDATE_ENTITY)->shouldReturn([$group]);
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:7,代码来源:VariantGroupUpdateGuesserSpec.php

示例4:

 function it_lists_user_notifications_linked_to_the_current_user(UserInterface $user, UserNotification $userNotification, Request $request, $manager, $context, $templating)
 {
     $context->getUser()->willReturn($user);
     $manager->getUserNotifications($user, Argument::cetera())->willReturn([$userNotification]);
     $templating->renderResponse('PimNotificationBundle:Notification:list.json.twig', ['userNotifications' => [$userNotification]], Argument::type('Symfony\\Component\\HttpFoundation\\JsonResponse'))->shouldBeCalled();
     $this->listAction($request);
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:7,代码来源:NotificationControllerSpec.php

示例5: it_should_add_default_options_when_making_a_call

 public function it_should_add_default_options_when_making_a_call($client, $request)
 {
     $request->getOptions()->shouldBeCalled()->willReturn([]);
     $request->setOptions(Argument::type('array'))->shouldBeCalled();
     $client->makeCall($request->getWrappedObject()->getFullUrl(), $request->getWrappedObject()->getHeaders(), [])->shouldBeCalled()->willReturn(['headers' => [], 'status' => 200, 'body' => '{"pubstatus": "usable", "_links": {"parent": {"href": "/", "title": "home"}, "collection": {"href": "items", "title": "items"}, "self": {"href": "items/tag:example.com,0001:newsml_BRE9A607", "title": "Item"}}, "body_text": "Andromeda and Milky Way will collide in about 2 billion years", "type": "text", "language": "en", "versioncreated": "2015-03-09T16:32:23+0000", "uri": "http://api.master.dev.superdesk.org/items/tag%3Aexample.com%2C0001%3Anewsml_BRE9A607", "version": "2", "headline": "Andromeda on a collision course"}']);
     $this->makeApiCall($request);
 }
开发者ID:superdesk,项目名称:web-publisher,代码行数:7,代码来源:GuzzleApiClientSpec.php

示例6: let

 function let(MetadataRendererInterface $universalRenderer, OptionsResolver $optionsResolver, PropertyAccessorInterface $propertyAccessor)
 {
     $this->beConstructedWith($universalRenderer, $optionsResolver, $propertyAccessor);
     $optionsResolver->setDefaults(Argument::type('array'))->willReturn($optionsResolver);
     $optionsResolver->setAllowedValues(Argument::any(), Argument::type('array'))->willReturn($optionsResolver);
     $optionsResolver->setAllowedTypes(Argument::any(), Argument::any())->willReturn($optionsResolver);
 }
开发者ID:sidibea,项目名称:Sylius,代码行数:7,代码来源:PageMetadataRendererSpec.php

示例7:

 function it_builds_form(FormBuilder $builder, FormFactoryInterface $factory)
 {
     $builder->add('type', 'sylius_promotion_rule_choice', Argument::type('array'))->willReturn($builder);
     $builder->getFormFactory()->willReturn($factory);
     $builder->addEventSubscriber(Argument::type(BuildRuleFormSubscriber::class))->shouldBeCalled();
     $this->buildForm($builder, ['configuration_type' => 'configuration_form_type']);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:7,代码来源:RuleTypeSpec.php

示例8: array

 function it_should_add_rule_event_subscriber(FormBuilder $builder, FormFactoryInterface $factory)
 {
     $builder->getFormFactory()->willReturn($factory);
     $builder->add(Argument::any(), Argument::cetera())->willReturn($builder);
     $builder->addEventSubscriber(Argument::type(BuildRuleFormSubscriber::class))->willReturn($builder);
     $this->buildForm($builder, array());
 }
开发者ID:Silwereth,项目名称:Sylius,代码行数:7,代码来源:RuleTypeSpec.php

示例9:

 function it_lists_user_notifications_linked_to_the_current_user($userNotifRepository, $context, $templating, UserInterface $user, UserNotificationInterface $userNotification, Request $request)
 {
     $context->getUser()->willReturn($user);
     $userNotifRepository->findBy(['user' => $user], ['id' => 'DESC'], 10, null)->willReturn([$userNotification]);
     $templating->renderResponse('PimNotificationBundle:Notification:list.json.twig', ['userNotifications' => [$userNotification]], Argument::type('Symfony\\Component\\HttpFoundation\\JsonResponse'))->shouldBeCalled();
     $this->listAction($request);
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:7,代码来源:NotificationControllerSpec.php

示例10: testCallBasicMethods

 /**
  * @dataProvider methodProvider
  */
 public function testCallBasicMethods($method, $args, $expectedArgs)
 {
     $this->requestWrapper->send(Argument::type('callable'), $expectedArgs, Argument::type('array'))->willReturn($this->successMessage);
     $grpc = new Grpc();
     $grpc->setRequestWrapper($this->requestWrapper->reveal());
     $this->assertEquals($this->successMessage, $grpc->{$method}($args));
 }
开发者ID:GoogleCloudPlatform,项目名称:gcloud-php,代码行数:10,代码来源:GrpcTest.php

示例11: array

 function it_should_build_form_with_proper_fields(FormBuilder $builder)
 {
     $builder->add('description', 'textarea', Argument::any())->shouldBeCalled()->willReturn($builder);
     $builder->add('parent', 'sylius_permission_choice', Argument::any())->shouldBeCalled()->willReturn($builder);
     $builder->addEventListener(FormEvents::PRE_SET_DATA, Argument::type('closure'))->shouldBeCalled()->willReturn($builder);
     $this->buildForm($builder, array());
 }
开发者ID:Silwereth,项目名称:Sylius,代码行数:7,代码来源:PermissionTypeSpec.php

示例12: testListenerShouldReturnBadRequestException

 public function testListenerShouldReturnBadRequestException()
 {
     $event = $this->prophesize(GetResponseForExceptionEvent::class);
     $event->getException()->willReturn(new ParamValidationFailedException(new ConstraintViolationList()));
     $event->setException(Argument::type(BadRequestHttpException::class))->shouldBeCalled();
     $this->listener->onKernelException($event->reveal());
 }
开发者ID:alekitto,项目名称:param-fetcher-bundle,代码行数:7,代码来源:ValidationFailedExceptionListenerTest.php

示例13:

 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

示例14:

 function it_tries_to_remove_a_coupon_and_catches_exception_in_case_of_failure(SharedStorageInterface $sharedStorage, RepositoryInterface $couponRepository, CouponInterface $coupon)
 {
     $coupon->getId()->willReturn(5);
     $couponRepository->remove($coupon)->willThrow(ForeignKeyConstraintViolationException::class);
     $sharedStorage->set('last_exception', Argument::type(ForeignKeyConstraintViolationException::class))->shouldBeCalled();
     $this->iTryToDeleteCoupon($coupon);
 }
开发者ID:Mozan,项目名称:Sylius,代码行数:7,代码来源:PromotionContextSpec.php

示例15:

 function it_builds_a_form(FormBuilderInterface $builder)
 {
     $builder->add('id', 'text', Argument::type('array'))->willReturn($builder);
     $builder->add('title', 'text', Argument::type('array'))->willReturn($builder);
     $builder->add('body', 'textarea', Argument::type('array'))->willReturn($builder);
     $this->buildForm($builder);
 }
开发者ID:Strontium-90,项目名称:Sylius,代码行数:7,代码来源:StaticPageTypeSpec.php


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