本文整理汇总了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, []);
}
示例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');
}
示例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();
}
示例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);
}
示例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());
}
示例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', '', []);
}
示例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']]);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}