本文整理匯總了PHP中Oro\Bundle\EntityConfigBundle\Config\ConfigManager::calculateConfigChangeSet方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigManager::calculateConfigChangeSet方法的具體用法?PHP ConfigManager::calculateConfigChangeSet怎麽用?PHP ConfigManager::calculateConfigChangeSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Oro\Bundle\EntityConfigBundle\Config\ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::calculateConfigChangeSet方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testConfigChangeSet
public function testConfigChangeSet()
{
$configId = new EntityConfigId('entity', self::ENTITY_CLASS);
$originalConfig = $this->getConfig($configId, ['item1' => true, 'item11' => true, 'item12' => true, 'item2' => 123, 'item21' => 123, 'item22' => 123, 'item3' => 'val2', 'item4' => 'val4', 'item6' => null, 'item7' => 'val7']);
$this->configCache->expects($this->once())->method('getEntityConfig')->willReturn($originalConfig);
$this->configManager->getConfig($configId);
$changedConfig = $this->getConfig($configId, ['item1' => true, 'item11' => 1, 'item12' => false, 'item2' => 123, 'item21' => '123', 'item22' => 456, 'item3' => 'val21', 'item5' => 'val5', 'item6' => 'val6', 'item7' => null]);
$this->configManager->persist($changedConfig);
$this->configManager->calculateConfigChangeSet($changedConfig);
$this->assertEquals(['item12' => [true, false], 'item22' => [123, 456], 'item3' => ['val2', 'val21'], 'item5' => [null, 'val5'], 'item6' => [null, 'val6'], 'item7' => ['val7', null]], $this->configManager->getConfigChangeSet($changedConfig));
}