本文整理汇总了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);
}
示例2:
function it_adds_a_novalidate_option($html)
{
// Expect
$html->attributes(Arg::containing('novalidate'))->shouldBeCalled();
// When
$this->novalidate(true);
$this->open(['method' => 'GET']);
}
示例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);
}
示例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());
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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', []));
}
示例10: AMQPMessage
function it_traces_the_span(ConsumerInterface $decoratedConsumer, Tracer $tracer)
{
$tracer->trace(Argument::containing(Argument::type(Span::class)))->shouldBeCalled();
$this->execute(new AMQPMessage(''));
}