當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。