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


PHP Argument::any方法代码示例

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


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

示例1:

 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

示例2:

 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

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

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

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

示例6:

 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

示例7:

 function it_normalizes_families(Family $family, Webservice $webservice, $familyNormalizer)
 {
     $familyNormalizer->normalize($family, AbstractNormalizer::MAGENTO_FORMAT, Argument::any())->willReturn(['attributeSetName' => 'family_code']);
     $webservice->getAttributeSetList()->willReturn([]);
     $webservice->getStoreViewsList()->willReturn([]);
     $this->process($family)->shouldReturn(['family_object' => $family, 'attributes_in_family' => null, 'families_to_create' => ['attributeSetName' => 'family_code']]);
 }
开发者ID:jarocks,项目名称:MagentoConnectorBundle,代码行数:7,代码来源:FamilyProcessorSpec.php

示例8: array

 function it_builds_form_with_proper_fields(FormBuilderInterface $builder)
 {
     $builder->add('type', 'text', Argument::any())->willReturn($builder);
     $builder->add('description', 'text', Argument::any())->willReturn($builder);
     $builder->add('amount', 'sylius_money', Argument::any())->willReturn($builder);
     $this->buildForm($builder, array());
 }
开发者ID:lingoda,项目名称:Sylius,代码行数:7,代码来源:AdjustmentTypeSpec.php

示例9:

 function it_supports_metric_attribute(AttributeInterface $metric)
 {
     $metric->getAttributeType()->willReturn('pim_catalog_metric');
     $this->supportsAttribute($metric)->shouldReturn(true);
     $metric->getAttributeType()->willReturn(Argument::any());
     $this->supportsAttribute($metric)->shouldReturn(false);
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:7,代码来源:MetricSorterSpec.php

示例10: _initMockClientFactory

 private function _initMockClientFactory()
 {
     $prophet = new \Prophecy\Prophet();
     $client = $prophet->prophesize("Bxav\\Bundle\\ServiceHandlerClientBundle\\Model\\SoapClient");
     $client->getFunctions()->willReturn([]);
     $this->clientFactory->get(Argument::any())->willReturn($client);
 }
开发者ID:bxav,项目名称:service_handler,代码行数:7,代码来源:ActionScannerSpec.php

示例11:

 function it_does_not_add_violation_product_price_with_no_data($context, ProductPriceInterface $productPrice, IsNumeric $numericConstraint)
 {
     $productPrice->getData()->willReturn(null);
     $context->buildViolation(Argument::cetera())->shouldNotBeCalled();
     $context->buildViolation(Argument::any())->shouldNotBeCalled();
     $this->validate($productPrice, $numericConstraint);
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:7,代码来源:IsNumericValidatorSpec.php

示例12: array

 function its_runAll_should_returns_only_failed_or_broken_tests(Runner $runner)
 {
     Filesystem::create()->serialize($this->cacheFile, array('succeed' => ResultEvent::createSucceed('Success'), 'failed' => ResultEvent::createFailed('Failed'), 'broken' => ResultEvent::createBroken('Broken')));
     $runner->run(Argument::any())->shouldBeCalled();
     $results = $this->runAll();
     $results->getResults()->shouldHaveCount(2);
 }
开发者ID:phpguard,项目名称:plugin-phpunit,代码行数:7,代码来源:InspectorSpec.php

示例13:

 function it_does_not_add_a_many_to_one_mapping_if_the_class_is_not_a_configured_attribute_value_model(LoadClassMetadataEventArgs $eventArgs, ClassMetadataInfo $metadata)
 {
     $eventArgs->getClassMetadata()->willReturn($metadata);
     $metadata->getName()->willReturn('KeepMoving\\ThisClass\\DoesNot\\Concern\\You');
     $metadata->mapManyToOne(Argument::any())->shouldNotBeCalled();
     $this->loadClassMetadata($eventArgs);
 }
开发者ID:Strontium-90,项目名称:Sylius,代码行数:7,代码来源:LoadMetadataSubscriberSpec.php

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

示例15: it_should_return_a_previously_registered_similar_aggregate_root_if_available

 public function it_should_return_a_previously_registered_similar_aggregate_root_if_available(AggregateRoot $aggregateRoot, $aggregateRoot1, $eventBus, $saveAggregateCallback)
 {
     $aggregateRoot1->sameIdentityAs($aggregateRoot)->willReturn(true);
     $aggregateRoot->addEventRegistrationCallback(Argument::any())->shouldNotBeCalled();
     $this->add($aggregateRoot, $eventBus, $saveAggregateCallback)->shouldReturn($aggregateRoot1);
     $this->all()->shouldHaveCount(2);
 }
开发者ID:jmolivas,项目名称:domain-foundation,代码行数:7,代码来源:DefaultAggregateContainerSpec.php


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