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


PHP Argument::containing方法代码示例

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


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

示例1:

 function it_adds_code_with_type_text_by_default(FormEvent $event, FormInterface $form, CodeAwareInterface $resource)
 {
     $event->getData()->willReturn($resource);
     $event->getForm()->willReturn($form);
     $resource->getCode()->shouldBeCalled()->willReturn('Code12');
     $form->add('code', 'text', Argument::containing(true))->shouldBeCalled();
     $this->preSetData($event);
 }
开发者ID:delphinBlue,项目名称:Sylius,代码行数:8,代码来源:AddCodeFormSubscriberSpec.php

示例2:

 function it_adds_a_novalidate_option($html)
 {
     // Expect
     $html->attributes(Arg::containing('novalidate'))->shouldBeCalled();
     // When
     $this->novalidate(true);
     $this->open(['method' => 'GET']);
 }
开发者ID:mcarral,项目名称:html,代码行数:8,代码来源:FormBuilderSpec.php

示例3:

 function it_sets_code_as_disabled_when_resource_is_not_new(FormEvent $event, FormInterface $form, CodeAwareInterface $resource)
 {
     $event->getData()->willReturn($resource);
     $event->getForm()->willReturn($form);
     $resource->getCode()->shouldBeCalled()->willReturn(null);
     $form->add('code', Argument::type('string'), Argument::containing(false))->shouldBeCalled();
     $this->preSetData($event);
 }
开发者ID:aleherse,项目名称:Sylius,代码行数:8,代码来源:AddCodeFormSubscriberSpec.php

示例4: testTagging

 public function testTagging()
 {
     $definitionObserver = $this->prophesize('\\Symfony\\Component\\DependencyInjection\\Definition');
     $definitionObserver->addMethodCall("addHelper", Argument::allOf(Argument::containing('test'), Argument::containing(new Reference('handlebars.helper.test'))))->shouldBeCalled();
     $containerObserver = $this->prophesize('\\Symfony\\Component\\DependencyInjection\\ContainerBuilder');
     $containerObserver->has('handlebars.helper')->willReturn(true)->shouldBeCalled();
     $containerObserver->findDefinition('handlebars.helper')->willReturn($definitionObserver->reveal())->shouldBeCalled();
     $taggedServices = ['handlebars.helper.test' => [['id' => 'test']]];
     $containerObserver->findTaggedServiceIds('handlebars.helper')->willReturn($taggedServices)->shouldBeCalled();
     $helperPass = new HelperPass();
     $helperPass->process($containerObserver->reveal());
 }
开发者ID:jayS-de,项目名称:HandlebarsBundle,代码行数:12,代码来源:HelperPassTest.php

示例5: RunnerEvent

 function it_should_pop_changes_when_an_error_occurs(Repository $repository)
 {
     $event = new RunnerEvent(new TasksCollection(), new GitPreCommitContext(new FilesCollection()), new TaskResultCollection());
     $repository->run('stash', Argument::containing('save'))->shouldBeCalled();
     $repository->run('stash', Argument::containing('pop'))->shouldBeCalled();
     $this->saveStash($event);
     $this->handleErrors();
 }
开发者ID:phpro,项目名称:grumphp,代码行数:8,代码来源:StashUnstagedChangesSubscriberSpec.php

示例6: it_should_attach_an_eventlistener

 /**
  * @param \Zend\EventManager\EventManager $eventManager
  */
 public function it_should_attach_an_eventlistener($eventManager)
 {
     $eventManager->attach('create', Argument::containing('create'), 1000)->shouldBeCalled();
     $this->attach($eventManager);
 }
开发者ID:phpro,项目名称:zf-apigility-doctrine-bulk,代码行数:8,代码来源:CreateListenerSpec.php

示例7:

 /**
  * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
  * @param \Symfony\Component\DependencyInjection\Definition $def
  */
 function it_adds_globals($container, $def)
 {
     $container->getParameter(Argument::any())->willReturn('test');
     $def->addMethodCall('addGlobal', Argument::containing('test'))->shouldBeCalled();
     $this->process($container);
 }
开发者ID:kbedn,项目名称:admin-bundle,代码行数:10,代码来源:TwigGlobalsPassSpec.php

示例8: let

 function let(RouteParser $parser, FastrouteDispatcherFactory $factory, Route $route, Dispatcher $dispatcher)
 {
     $parser->parse(Argument::containing($route->getWrappedObject()))->willReturn(['parsed']);
     $factory->create(['parsed'])->willReturn($dispatcher);
     $this->beConstructedWith($parser, $factory);
 }
开发者ID:abava,项目名称:routing,代码行数:6,代码来源:RouteMatcherSpec.php

示例9: testRender

 public function testRender()
 {
     $loader = $this->prophesize('JaySDe\\HandlebarsBundle\\Loader\\FilesystemLoader');
     $helper = $this->prophesize('JaySDe\\HandlebarsBundle\\HandlebarsHelperService');
     $profiler = $this->prophesize('JaySDe\\HandlebarsBundle\\HandlebarsProfileExtension');
     $profiler->enter(Argument::type('Twig_Profiler_Profile'))->shouldBeCalled();
     $profiler->leave(Argument::type('Twig_Profiler_Profile'))->shouldBeCalled();
     $cache = $this->prophesize('JaySDe\\HandlebarsBundle\\Cache\\Filesystem');
     $cache->generateKey('test')->willReturn('test');
     $cache->isFresh('test')->willReturn(true);
     $cache->load('test')->willReturn(function () {
         return 'hello world';
     });
     $cache->write('test', Argument::any(), Argument::containing(Argument::type('Symfony\\Component\\Config\\Resource\\FileResource')))->shouldBeCalled();
     $environment = new HandlebarsEnvironment($loader->reveal(), $helper->reveal(), ['auto_reload' => true], $cache->reveal(), $profiler->reveal());
     $this->assertSame('hello world', $environment->render('test', []));
 }
开发者ID:jayS-de,项目名称:HandlebarsBundle,代码行数:17,代码来源:HandlebarsEnvironmentTest.php

示例10: AMQPMessage

 function it_traces_the_span(ConsumerInterface $decoratedConsumer, Tracer $tracer)
 {
     $tracer->trace(Argument::containing(Argument::type(Span::class)))->shouldBeCalled();
     $this->execute(new AMQPMessage(''));
 }
开发者ID:sroze,项目名称:tolerance,代码行数:5,代码来源:TracedConsumerSpec.php


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