本文整理汇总了PHP中Configuration::setClassConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::setClassConfig方法的具体用法?PHP Configuration::setClassConfig怎么用?PHP Configuration::setClassConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::setClassConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetInstanceWithWrongConfiguredParameterThrowsException
public function testGetInstanceWithWrongConfiguredParameterThrowsException()
{
$this->setExpectedException('rg\\injektor\\InjectionException', 'Invalid argument without class typehint class: [rg\\injektor\\DICTestClassNoTypeHint] method: [__construct] argument: [two]');
$config = new Configuration(null, '');
$config->setClassConfig('rg\\injektor\\DICTestClassNoTypeHint', array('params' => array('one' => array('value' => 'foo'))));
$dic = $this->getContainer($config);
$dic->getInstanceOfClass('rg\\injektor\\DICTestClassNoTypeHint');
}
示例2: testSetConfig
public function testSetConfig()
{
$config = new Configuration(null, '');
$config->setClassConfig('foo', array('bar'));
$this->assertEquals(array('bar'), $config->getClassConfig('foo'));
}
示例3: testConfiguredProvidedByWithParameters
public function testConfiguredProvidedByWithParameters()
{
$config = new Configuration(null, __DIR__ . '/_factories');
$config->setClassConfig('rg\\injektor\\DICTestInterface', ['provider' => ['class' => 'rg\\injektor\\DICSimpleTestProvider', 'parameters' => ['name' => 'impl1']]]);
$dic = $this->getContainer($config);
/** @var DICTestInterfaceDependency $instance */
$instance = $dic->getInstanceOfClass('rg\\injektor\\DICTestInterfaceDependency');
$this->assertInstanceOf('rg\\injektor\\DICTestSimpleProvidedDecorator', $instance->dependency);
$this->assertInstanceOf('rg\\injektor\\DICTestProvidedInterfaceImpl1', $instance->dependency->getProvidedClass());
}