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


PHP Argument::cetera方法代码示例

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


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

示例1:

 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

示例2:

 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

示例3:

 function it_builds_form(FormBuilderInterface $builder)
 {
     $builder->add('rating', 'choice', Argument::cetera())->willReturn($builder)->shouldBeCalled();
     $builder->add('title', 'text', Argument::cetera())->willReturn($builder)->shouldBeCalled();
     $builder->add('comment', 'textarea', Argument::cetera())->willReturn($builder)->shouldBeCalled();
     $this->buildForm($builder, ['rating_steps' => 5]);
 }
开发者ID:loic425,项目名称:Sylius,代码行数:7,代码来源:ReviewTypeSpec.php

示例4:

 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

示例5:

 function it_does_not_notify_if_job_execution_has_no_user($event, $jobExecution, $manager)
 {
     $jobExecution->getUser()->willReturn(null);
     $jobExecution->getStatus()->shouldNotBeCalled();
     $manager->notify(Argument::cetera())->shouldNotBeCalled();
     $this->afterJobExecution($event);
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:7,代码来源:JobExecutionNotifierSpec.php

示例6:

 function it_throws_an_exception_if_something_went_wrong_with_magento_calls(Category $category, $webservice, $categoryMappingManager)
 {
     $batches = [['create' => [['pimCategory' => $category, 'magentoCategory' => ['foo']]]]];
     $webservice->sendNewCategory(['foo'])->willThrow('\\Pim\\Bundle\\MagentoConnectorBundle\\Webservice\\SoapCallException');
     $categoryMappingManager->registerCategoryMapping(Argument::cetera())->shouldNotBeCalled();
     $this->shouldThrow('\\Akeneo\\Bundle\\BatchBundle\\Item\\InvalidItemException')->duringWrite($batches);
 }
开发者ID:rskonieczka,项目名称:MagentoConnectorBundle,代码行数:7,代码来源:CategoryWriterSpec.php

示例7:

 function it_creates_query_builder_for_all_status($em, QueryBuilder $builder)
 {
     $em->createQueryBuilder()->shouldBeCalled()->willReturn($builder);
     $builder->select('method')->shouldBeCalled()->willReturn($builder);
     $builder->from(Argument::any(), 'method', Argument::cetera())->shouldBeCalled()->willReturn($builder);
     $this->getQueryBuidlerForChoiceType(array('disabled' => true))->shouldReturn($builder);
 }
开发者ID:scohan,项目名称:Sylius,代码行数:7,代码来源:PaymentMethodRepositorySpec.php

示例8: foreach

 function it_copies_simple_select_value_to_a_product_value($builder, $attrValidatorHelper, AttributeInterface $fromAttribute, AttributeInterface $toAttribute, ProductInterface $product1, ProductInterface $product2, ProductInterface $product3, ProductInterface $product4, ProductValueInterface $fromProductValue, ProductValueInterface $toProductValue, AttributeOptionInterface $attributeOption)
 {
     $fromLocale = 'fr_FR';
     $toLocale = 'fr_FR';
     $toScope = 'mobile';
     $fromScope = 'mobile';
     $fromAttribute->getCode()->willReturn('fromAttributeCode');
     $toAttribute->getCode()->willReturn('toAttributeCode');
     $attrValidatorHelper->validateLocale(Argument::cetera())->shouldBeCalled();
     $attrValidatorHelper->validateScope(Argument::cetera())->shouldBeCalled();
     $fromProductValue->getData()->willReturn($attributeOption);
     $toProductValue->setOption($attributeOption)->shouldBeCalledTimes(3);
     $product1->getValue('fromAttributeCode', $fromLocale, $fromScope)->willReturn($fromProductValue);
     $product1->getValue('toAttributeCode', $toLocale, $toScope)->willReturn($toProductValue);
     $product2->getValue('fromAttributeCode', $fromLocale, $fromScope)->willReturn(null);
     $product2->getValue('toAttributeCode', $toLocale, $toScope)->willReturn($toProductValue);
     $product3->getValue('fromAttributeCode', $fromLocale, $fromScope)->willReturn($fromProductValue);
     $product3->getValue('toAttributeCode', $toLocale, $toScope)->willReturn(null);
     $product4->getValue('fromAttributeCode', $fromLocale, $fromScope)->willReturn($fromProductValue);
     $product4->getValue('toAttributeCode', $toLocale, $toScope)->willReturn($toProductValue);
     $builder->addProductValue($product3, $toAttribute, $toLocale, $toScope)->shouldBeCalledTimes(1)->willReturn($toProductValue);
     $products = [$product1, $product2, $product3, $product4];
     foreach ($products as $product) {
         $this->copyAttributeData($product, $product, $fromAttribute, $toAttribute, ['from_locale' => $fromLocale, 'to_locale' => $toLocale, 'from_scope' => $fromScope, 'to_scope' => $toScope]);
     }
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:26,代码来源:SimpleSelectAttributeCopierSpec.php

示例9: let

 function let(ChannelManager $channelManager, MediaManager $mediaManager, ProductValueNormalizer $productValueNormalizer, CategoryMappingManager $categoryMappingManager, AssociationTypeManager $associationTypeManager, MappingCollection $storeViewMapping, MappingCollection $categoryMapping, MappingCollection $attributeMapping, Product $product, ProductValue $productValue, ProductValue $imageValue, Channel $channel, Locale $localeFR, Locale $localeEN, Category $category)
 {
     $this->beConstructedWith($channelManager, $mediaManager, $productValueNormalizer, $categoryMappingManager, $associationTypeManager, 1, 4, 'currency', 'magento_url');
     $this->globalContext = ['attributeSetId' => 0, 'magentoAttributes' => [], 'magentoAttributesOptions' => [], 'storeViewMapping' => $storeViewMapping, 'magentoStoreViews' => [['code' => 'fr_fr']], 'defaultLocale' => 'default_locale', 'website' => 'website', 'channel' => 'channel', 'categoryMapping' => $categoryMapping, 'attributeCodeMapping' => $attributeMapping, 'create' => true, 'pimGrouped' => 'pim_grouped', 'created_date' => new \DateTime(), 'updated_date' => new \DateTime(), 'defaultStoreView' => 'default', 'smallImageAttribute' => 'small_image_attribute', 'baseImageAttribute' => 'image_attribute', 'thumbnailAttribute' => 'image_attribute'];
     $attributeMapping->getTarget('visibility')->willReturn('visibility');
     $attributeMapping->getTarget('created_at')->willReturn('created_at');
     $attributeMapping->getTarget('updated_at')->willReturn('updated_at');
     $attributeMapping->getTarget('status')->willReturn('status');
     $attributeMapping->getTarget('categories')->willReturn('categories');
     $channelManager->getChannelByCode('channel')->willReturn($channel);
     $channel->getLocales()->willReturn([$localeEN, $localeFR]);
     $localeEN->getCode()->willReturn('default_locale');
     $localeFR->getCode()->willReturn('fr_FR');
     $channel->getCode()->willReturn('channel_code');
     $channel->getCategory()->willReturn($category);
     $product->getCategories()->willReturn([$category]);
     $product->getIdentifier()->willReturn('sku-000');
     $product->getCreated()->willReturn($this->globalContext['created_date']);
     $product->getUpdated()->willReturn($this->globalContext['updated_date']);
     $product->getValues()->willReturn(new ArrayCollection([$productValue, $imageValue]));
     $storeViewMapping->getTarget('default_locale')->willReturn('default_locale');
     $storeViewMapping->getTarget('fr_FR')->willReturn('fr_fr');
     $categoryMappingManager->getIdFromCategory($category, 'magento_url', $categoryMapping)->willReturn(2);
     $productValueNormalizer->normalize($productValue, Argument::cetera())->willReturn(['value' => 'productValueNormalized']);
     $productValueNormalizer->normalize($imageValue, Argument::cetera())->willReturn(null);
 }
开发者ID:jarocks,项目名称:MagentoConnectorBundle,代码行数:26,代码来源:ProductNormalizerSpec.php

示例10: UnsupportedDriverActionException

 function it_does_not_report_screenshot_taking_not_supported_errors_on_screen(OutputInterface $output, Session $session, DriverInterface $driver)
 {
     $output->writeln(Argument::cetera())->shouldNotBeCalled();
     $driverInstance = $driver->getWrappedObject();
     $session->getScreenshot()->willThrow(new UnsupportedDriverActionException('Message.', $driverInstance));
     $this->takeScreenshot();
 }
开发者ID:elvetemedve,项目名称:behat-screenshot,代码行数:7,代码来源:ScreenshotTakerSpec.php

示例11: testPicksTheFirstSuitableResolverToResolveTheGivenValue

 public function testPicksTheFirstSuitableResolverToResolveTheGivenValue()
 {
     $value = new FakeValue();
     $fixture = new FakeFixture();
     $set = ResolvedFixtureSetFactory::create();
     $scope = ['scope' => 'epocs'];
     $context = new GenerationContext();
     $context->markIsResolvingFixture('foo');
     $expected = new ResolvedValueWithFixtureSet(10, ResolvedFixtureSetFactory::create(null, null, (new ObjectBag())->with(new SimpleObject('dummy', new \stdClass()))));
     $instantiator1Prophecy = $this->prophesize(ChainableValueResolverInterface::class);
     $instantiator1Prophecy->canResolve($value)->willReturn(false);
     /* @var ChainableValueResolverInterface $instantiator1 */
     $instantiator1 = $instantiator1Prophecy->reveal();
     $instantiator2Prophecy = $this->prophesize(ChainableValueResolverInterface::class);
     $instantiator2Prophecy->canResolve($value)->willReturn(true);
     $instantiator2Prophecy->resolve($value, $fixture, $set, $scope, $context)->willReturn($expected);
     /* @var ChainableValueResolverInterface $instantiator2 */
     $instantiator2 = $instantiator2Prophecy->reveal();
     $instantiator3Prophecy = $this->prophesize(ChainableValueResolverInterface::class);
     $instantiator3Prophecy->canResolve(Argument::any())->shouldNotBeCalled();
     /* @var ChainableValueResolverInterface $instantiator3 */
     $instantiator3 = $instantiator3Prophecy->reveal();
     $registry = new ValueResolverRegistry([$instantiator1, $instantiator2, $instantiator3]);
     $actual = $registry->resolve($value, $fixture, $set, $scope, $context);
     $this->assertSame($expected, $actual);
     $instantiator1Prophecy->canResolve(Argument::any())->shouldHaveBeenCalledTimes(1);
     $instantiator2Prophecy->canResolve(Argument::any())->shouldHaveBeenCalledTimes(1);
     $instantiator2Prophecy->resolve(Argument::cetera())->shouldHaveBeenCalledTimes(1);
 }
开发者ID:nelmio,项目名称:alice,代码行数:29,代码来源:ValueResolverRegistryTest.php

示例12: exceptionWhileParsingLongUrlOutputsError

 /**
  * @test
  */
 public function exceptionWhileParsingLongUrlOutputsError()
 {
     $this->urlShortener->urlToShortCode(Argument::cetera())->willThrow(new InvalidUrlException())->shouldBeCalledTimes(1);
     $this->commandTester->execute(['command' => 'shortcode:generate', 'longUrl' => 'http://domain.com/invalid']);
     $output = $this->commandTester->getDisplay();
     $this->assertTrue(strpos($output, 'Provided URL "http://domain.com/invalid" is invalid. Try with a different one.') === 0);
 }
开发者ID:shlinkio,项目名称:shlink,代码行数:10,代码来源:GenerateShortcodeCommandTest.php

示例13: alreadyProcessedElementsAreNotProcessed

 /**
  * @test
  */
 public function alreadyProcessedElementsAreNotProcessed()
 {
     $url = 'http://foo.com';
     $this->filesystem->exists(sprintf('dir/preview_%s.png', urlencode($url)))->willReturn(true)->shouldBeCalledTimes(1);
     $this->image->saveAs(Argument::cetera())->shouldBeCalledTimes(0);
     $this->assertEquals(sprintf('dir/preview_%s.png', urlencode($url)), $this->generator->generatePreview($url));
 }
开发者ID:shlinkio,项目名称:shlink,代码行数:10,代码来源:PreviewGeneratorTest.php

示例14:

 function it_gets_form_from_class_name(Configuration $configuration, FormFactoryInterface $formFactory, FormInterface $form)
 {
     $formClass = 'spec\\Sylius\\Bundle\\ResourceBundle\\Controller\\TestFormType';
     $configuration->getFormType()->willReturn($formClass);
     $formFactory->create(Argument::type($formClass), Argument::cetera())->shouldBeCalled()->willReturn($form);
     $this->getForm()->shouldReturn($form);
 }
开发者ID:Strontium-90,项目名称:Sylius,代码行数:7,代码来源:ResourceControllerSpec.php

示例15:

 function it_falls_back_to_decorated_template_locator_if_there_are_no_themes_active(FileLocatorInterface $decoratedFileLocator, ThemeContextInterface $themeContext, ThemeHierarchyProviderInterface $themeHierarchyProvider, TemplateReferenceInterface $template)
 {
     $themeContext->getTheme()->willReturn(null);
     $themeHierarchyProvider->getThemeHierarchy(null)->willReturn([]);
     $decoratedFileLocator->locate($template, Argument::cetera())->willReturn('/app/template/path');
     $this->locate($template)->shouldReturn('/app/template/path');
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:7,代码来源:TemplateFileLocatorSpec.php


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