本文整理汇总了PHP中Prophecy\Prophecy\ObjectProphecy::has方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectProphecy::has方法的具体用法?PHP ObjectProphecy::has怎么用?PHP ObjectProphecy::has使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prophecy\Prophecy\ObjectProphecy
的用法示例。
在下文中一共展示了ObjectProphecy::has方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testKnowsDependency
/**
* @covers ::knowsDependency
* @covers ::__construct
*/
public function testKnowsDependency()
{
$this->container->has('known_dependency')->willReturn(true);
$this->container->has('unknown_dependency')->willReturn(false);
$this->assertTrue($this->sut->knowsDependency('known_dependency'));
$this->assertFalse($this->sut->knowsDependency('unknown_dependency'));
}
开发者ID:bartfeenstra,项目名称:dependency-retriever-symfony-bridge,代码行数:11,代码来源:ContainerServiceRetrieverTest.php
示例2: testGetDirectory
public function testGetDirectory()
{
$path = 'path';
$this->prophecy->has($path)->willReturn(true);
$this->prophecy->getMetadata($path)->willReturn(['path' => $path, 'type' => 'dir']);
$output = $this->filesystem->get($path);
$this->assertInstanceOf('League\\Flysystem\\Directory', $output);
}
示例3: containerDoesNotHaveService
public static function containerDoesNotHaveService(ObjectProphecy $container, $service)
{
$container->has($service)->willReturn(false);
}
示例4: testHas
/**
* @covers ::has
*
* @dataProvider providerHas
*
* @param bool $exists
* @param string $key
*/
public function testHas($exists, $key)
{
$this->decoratedFormState->has($key)->willReturn($exists)->shouldBeCalled();
$this->assertSame($exists, $this->formStateDecoratorBase->has($key));
}