本文整理汇总了PHP中Interop\Container\ContainerInterface::method方法的典型用法代码示例。如果您正苦于以下问题:PHP ContainerInterface::method方法的具体用法?PHP ContainerInterface::method怎么用?PHP ContainerInterface::method使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interop\Container\ContainerInterface
的用法示例。
在下文中一共展示了ContainerInterface::method方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInitServices_Inheritance
public function testInitServices_Inheritance()
{
$mapHas = [['propA', true], ['propB', true], ['propC', true], ['newPropA', true]];
$this->container->method('has')->will($this->returnValueMap($mapHas));
$mapGet = [['propA', 'PropA value'], ['propB', new \ArrayObject()], ['propC', new \stdClass()], ['newPropA', 'PropNewA value']];
$this->container->method('get')->will($this->returnValueMap($mapGet));
$tested = new Inheritance();
$this->assertEquals('PropNewA value', $tested->propA);
}
示例2: test_it_throws_exception_on_not_implemented_transport
/**
* @test
* @expectedException \InvalidArgumentException
*/
public function test_it_throws_exception_on_not_implemented_transport()
{
$this->containerMock->method('get')->will($this->returnValue(['proophessor-do' => ['mail' => ['transport' => 'missing']]]));
$factory = $this->factory;
$factory($this->containerMock);
}