本文整理汇总了PHP中PHPUnit_Framework_MockObject_MockObject::getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_MockObject_MockObject::getConfiguration方法的具体用法?PHP PHPUnit_Framework_MockObject_MockObject::getConfiguration怎么用?PHP PHPUnit_Framework_MockObject_MockObject::getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_MockObject_MockObject
的用法示例。
在下文中一共展示了PHPUnit_Framework_MockObject_MockObject::getConfiguration方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configuration
/**
* @test
*/
public function configuration()
{
$this->fixture->setConfiguration(['test' => 'test']);
$this->assertEquals(['test' => 'test'], $this->fixture->getConfiguration());
$this->fixture->addConfiguration('test2', 'test2');
$this->assertEquals(['test' => 'test', 'test2' => 'test2'], $this->fixture->getConfiguration());
}
示例2: testGetConfiguration
/**
* @covers ::setConfiguration
* @covers ::getConfiguration
*/
public function testGetConfiguration()
{
$configuration = array($this->randomMachineName() => mt_rand()) + $this->sut->defaultConfiguration();
$return = $this->sut->setConfiguration($configuration);
$this->assertNull($return);
$this->assertSame($configuration, $this->sut->getConfiguration());
}
示例3: setUp
protected function setUp()
{
$metadataDriver = new AnnotationDriver(new AnnotationReader(), self::ENTITY_NAMESPACE);
$this->emMock = $this->getTestEntityManager();
$this->emMock->getConfiguration()->setMetadataDriverImpl($metadataDriver);
$this->extendConfigProvider = $this->getExtendConfigMock();
}
示例4: testSetDefaultOptions
public function testSetDefaultOptions()
{
$reader = new AnnotationReader();
$metadataDriver = new AnnotationDriver($reader, 'Oro\\Bundle\\IntegrationBundle\\Tests\\Unit\\Fixture\\Entity');
$this->em->getConfiguration()->setMetadataDriverImpl($metadataDriver);
$this->em->getConfiguration()->setEntityNamespaces(['OroIntegrationBundle' => 'Oro\\Bundle\\IntegrationBundle\\Tests\\Unit\\Fixture\\Entity']);
$resolver = new OptionsResolver();
$this->type->setDefaultOptions($resolver);
$resolved = $resolver->resolve(['configs' => ['placeholder' => 'testPlaceholder'], 'allowed_types' => ['testType']]);
$this->assertInstanceOf('Symfony\\Bridge\\Doctrine\\Form\\ChoiceList\\EntityChoiceList', $resolved['choice_list']);
}
示例5: setUp
public function setUp()
{
$this->contextRegistry = $this->getMockBuilder('Oro\\Bundle\\ImportExportBundle\\Context\\ContextRegistry')->disableOriginalConstructor()->setMethods(array('getByStepExecution'))->getMock();
$this->managerRegistry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
$reader = new AnnotationReader();
$metadataDriver = new AnnotationDriver($reader, 'Oro\\Bundle\\IntegrationBundle\\Entity');
$ownershipMetadataProvider = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\Owner\\Metadata\\OwnershipMetadataProvider')->disableOriginalConstructor()->getMock();
$this->em = $this->getTestEntityManager();
$config = $this->em->getConfiguration();
$config->setMetadataDriverImpl($metadataDriver);
$config->setEntityNamespaces(['OroIntegrationBundle' => 'Oro\\Bundle\\IntegrationBundle\\Entity']);
$this->reader = new EntityReaderById($this->contextRegistry, $this->managerRegistry, $ownershipMetadataProvider);
}
示例6: cachingOfActionsCanNotBeChanged
/**
* @test
*/
public function cachingOfActionsCanNotBeChanged()
{
$configuration = array('extensionName' => 'CurrentExtensionName', 'pluginName' => 'CurrentPluginName', 'switchableControllerActions' => array('Controller1' => array('newAction', 'action1'), 'Controller2' => array('newAction2', 'action4', 'action5')));
$this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
$this->abstractConfigurationManager->setConfiguration($configuration);
$this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
$this->abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testSwitchableControllerActions));
$this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnCallBack(create_function('$a', 'return $a;')));
$mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
$expectedResult = array('Controller1' => array('actions' => array('newAction', 'action1')), 'Controller2' => array('actions' => array('newAction2', 'action4', 'action5'), 'nonCacheableActions' => array('action4')));
$actualResult = $mergedConfiguration['controllerConfiguration'];
$this->assertEquals($expectedResult, $actualResult);
}
示例7: testGetConfiguration
/**
* @covers ::setConfiguration
* @covers ::getConfiguration
*/
public function testGetConfiguration()
{
$configuration = ['foo' => $this->randomMachineName()];
$this->assertNull($this->sut->setConfiguration($configuration));
$this->assertSame($configuration, $this->sut->getConfiguration());
}
示例8: testGetConfiguration
/**
* @covers ::setConfiguration
* @covers ::getConfiguration
*/
public function testGetConfiguration()
{
$configuration = array($this->randomMachineName());
$this->assertSame($this->sut, $this->sut->setConfiguration($configuration));
$this->assertSame($configuration, $this->sut->getConfiguration());
}