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


PHP Prophecy\Argument类代码示例

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


在下文中一共展示了Argument类的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_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

示例4:

 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

示例5:

 function it_does_not_filters_when_data_id_is_not_defined(DataSourceInterface $dataSource, ExpressionBuilderInterface $expressionBuilder)
 {
     $dataSource->getExpressionBuilder()->willReturn($expressionBuilder);
     $expressionBuilder->equals('entity', Argument::any())->shouldNotBeCalled();
     $dataSource->restrict(Argument::any())->shouldNotBeCalled();
     $this->apply($dataSource, 'entity', '', []);
 }
开发者ID:NeverResponse,项目名称:Sylius,代码行数:7,代码来源:EntityFilterSpec.php

示例6:

 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

示例7: array

 function it_builds_a_form(FormBuilderInterface $builder)
 {
     $builder->add('first_item_cost', 'sylius_money', Argument::withKey('constraints'))->shouldBeCalled()->willReturn($builder);
     $builder->add('additional_item_cost', 'sylius_money', Argument::withKey('constraints'))->shouldBeCalled()->willReturn($builder);
     $builder->add('additional_item_limit', 'integer', Argument::withKey('constraints'))->shouldBeCalled()->willReturn($builder);
     $this->buildForm($builder, array());
 }
开发者ID:Silwereth,项目名称:Sylius,代码行数:7,代码来源:FlexibleRateConfigurationTypeSpec.php

示例8: 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

示例9:

 function it_processes_homogeneous_items($serializer, $localeRepository)
 {
     $items = [['item1' => ['attr10']], ['item2' => 'attr20'], ['item3' => ['attr30']]];
     $localeRepository->getActivatedLocaleCodes()->willReturn(['code1', 'code2']);
     $serializer->serialize(Argument::cetera())->willReturn('those;items;in;csv;format;');
     $this->process($items)->shouldReturn('those;items;in;csv;format;');
 }
开发者ID:qrz-io,项目名称:pim-community-dev,代码行数:7,代码来源:HomogeneousProcessorSpec.php

示例10: getVariantImageMock

 /**
  * Get variant image resolver mock.
  *
  * @param ImageInterface|false $image Image
  *
  * @return VariantImageResolver
  */
 protected function getVariantImageMock($image)
 {
     $variantImageResolver = $this->prophesize('Elcodi\\Component\\Product\\ImageResolver\\VariantImageResolver');
     $variantImageResolver->getValidImage(Argument::any())->willReturn($image);
     $variantImageResolver->getPurchasableNamespace()->willReturn('Elcodi\\Component\\Product\\Entity\\Interfaces\\VariantInterface');
     return $variantImageResolver->reveal();
 }
开发者ID:IRlyDontKnow,项目名称:elcodi,代码行数:14,代码来源:AbstractImageResolverTest.php

示例11: let

 function let(GroupRepositoryInterface $groupRepository, DenormalizerInterface $denormalizer, ValidatorInterface $validator, ObjectDetacherInterface $detacher, StepExecution $stepExecution)
 {
     $groupClass = 'Pim\\Bundle\\CatalogBundle\\Entity\\Group';
     $this->beConstructedWith($groupRepository, $denormalizer, $validator, $detacher, $groupClass, 'csv');
     $this->setStepExecution($stepExecution);
     $validator->validate(Argument::any())->willReturn(new ConstraintViolationList());
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:7,代码来源:GroupProcessorSpec.php

示例12:

 function it_hydrates_a_result_record(Builder $builder, Query $query, ProductInterface $product, Association $association, AssociationType $associationType, ProductInterface $associatedProduct1, ProductInterface $associatedProduct2, DocumentManager $documentManager, \Doctrine\ODM\MongoDB\Mapping\ClassMetadata $metadata, Collection $collection, ArrayIterator $arrayIterator)
 {
     $options = ['locale_code' => 'en_US', 'scope_code' => 'print', 'current_group_id' => null, 'attributes_configuration' => [], 'association_type_id' => 1, 'current_product' => $product];
     $builder->getQuery()->willReturn($query);
     $builder->hydrate(false)->willReturn($builder);
     $associatedProduct1->getId()->willReturn('550ae6b98ead0ed7778b46bb');
     $associatedProduct2->getId()->willReturn('550ae6b98abd0ec8778b46bb');
     $product->getAssociations()->willReturn([$association]);
     $association->getAssociationType()->willReturn($associationType);
     $associationType->getId()->willReturn(1);
     $association->getProducts()->willReturn([$associatedProduct1, $associatedProduct2]);
     $queryDefinition = ['type' => 1, 'sort' => ['normalizedData.is_associated' => -1, '_id' => 1], 'limit' => 10, 'skip' => 0, 'query' => ['_id' => ['$ne' => \MongoId::__set_state(['$id' => '550ae6b98ead0ee8778b46bb'])]], 'newObj' => []];
     $query->getQuery()->willReturn($queryDefinition);
     $query->getDocumentManager()->willReturn($documentManager);
     $documentManager->getDocumentCollection(Argument::any())->willReturn($collection);
     $documentManager->getClassMetadata(Argument::any())->willReturn($metadata);
     $metadata->getFieldNames()->willReturn(['id', 'created', 'updated', 'locale', 'scope', 'values', 'indexedValues', 'indexedValuesOutdated', 'family', 'familyId', 'categories', 'categoryIds', 'enabled', 'groups', 'groupIds', 'associations', 'completenesses', 'normalizedData']);
     $pipeline = [['$match' => ['_id' => ['$ne' => \MongoId::__set_state(['$id' => '550ae6b98ead0ee8778b46bb'])]]], ['$project' => ['id' => 1, 'created' => 1, 'updated' => 1, 'locale' => 1, 'scope' => 1, 'values' => 1, 'indexedValues' => 1, 'indexedValuesOutdated' => 1, 'family' => 1, 'familyId' => 1, 'categories' => 1, 'categoryIds' => 1, 'enabled' => 1, 'groups' => 1, 'groupIds' => 1, 'associations' => 1, 'completenesses' => 1, 'normalizedData' => 1, 'is_associated' => ['$cond' => [['$or' => [['$eq' => ['$_id', \MongoId::__set_state(['$id' => '550ae6b98ead0ed7778b46bb'])]], ['$eq' => ['$_id', \MongoId::__set_state(['$id' => '550ae6b98abd0ec8778b46bb'])]]]], 1, 0]]]], ['$sort' => ['is_associated' => -1]], ['$skip' => 0], ['$limit' => 10]];
     $collection->aggregate($pipeline)->willReturn($arrayIterator);
     $fixture = ['_id' => \MongoId::__set_state(['$id' => '550ae6b98ead0ee8778b46bb']), 'normalizedData' => [], 'sku' => ['attribute' => ['code' => 'sku', 'attributeType' => 'text', 'backendType' => 'text'], 'locale' => null, 'scope' => null, 'value' => 'mysku'], 'name' => ['attribute' => ['code' => 'name', 'attributeType' => 'text', 'backendType' => 'text'], 'locale' => 'fr_FR', 'scope' => null], 'desc' => ['attribute' => ['code' => 'desc', 'attributeType' => 'text', 'backendType' => 'text'], 'locale' => 'fr_FR', 'scope' => 'print'], 'is_associated' => 1];
     $arrayIterator->toArray()->willReturn([$fixture]);
     $rows = $this->hydrate($builder, $options);
     $rows->shouldHaveCount(1);
     $firstResult = $rows[0];
     $firstResult->shouldBeAnInstanceOf('\\Oro\\Bundle\\DataGridBundle\\Datasource\\ResultRecord');
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:26,代码来源:AssociatedProductHydratorSpec.php

示例13:

 function it_should_pre_load_configuration_properly(GenericEvent $event, ContainerInterface $container, PhpGuard $guard, InputInterface $input)
 {
     $input->hasParameterOption(Argument::cetera())->willReturn(false);
     $container->get('phpguard')->willReturn($guard);
     $guard->setOptions(array())->shouldBeCalled();
     $this->preLoad($event);
 }
开发者ID:phpguard,项目名称:phpguard,代码行数:7,代码来源:ConfigurationListenerSpec.php

示例14: getProphetClient

 /**
  * @param mixed $params
  * @param bool $isArray
  * @return JsonRpcClient
  */
 private function getProphetClient($params, $isArray)
 {
     $guzzle = $this->prophesize(ClientInterface::class);
     $self = $this;
     $guzzle->sendAsync(Argument::type(RequestInterface::class))->will(function ($args) use($self, $params, $isArray) {
         /** @var RequestInterface $request */
         $request = $args[0];
         $content = $request->getBody()->getContents();
         $data = json_decode($content);
         if ($isArray) {
             $self::assertTrue(is_array($data));
             $self::assertNotEmpty($data);
             $data = array_shift($data);
         }
         $self::assertEquals(JSON_ERROR_NONE, json_last_error());
         $self::assertObjectHasAttribute('id', $data);
         $self::assertObjectHasAttribute('method', $data);
         $self::assertObjectHasAttribute('params', $data);
         $self::assertObjectHasAttribute('jsonrpc', $data);
         $self::assertEquals('test', $data->id);
         $self::assertEquals('2.0', $data->jsonrpc);
         $self::assertEquals('test', $data->method);
         $self::assertEquals($params, $data->params);
         return new Promise(function () {
         }, function () {
         });
     });
     return new JsonRpcClient($guzzle->reveal(), new Uri('http://localhost/'));
 }
开发者ID:scaytrase,项目名称:json-rpc-client,代码行数:34,代码来源:JsonRpcClientTest.php

示例15:

 function it_has_options(OptionsResolver $resolver)
 {
     $resolver->setDefaults(Argument::withKey('choice_list'))->shouldBeCalled()->willReturn($resolver);
     $resolver->setRequired(['variable'])->shouldBeCalled()->willReturn($resolver);
     $resolver->setAllowedTypes('variable', VariableInterface::class)->shouldBeCalled()->willReturn($resolver);
     $this->configureOptions($resolver);
 }
开发者ID:okwinza,项目名称:Sylius,代码行数:7,代码来源:VariantChoiceTypeSpec.php


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