예제 #1
0
 public function testPrePersistEntityConfigWithoutOwnership()
 {
     $config = new Config(new EntityConfigId('ownership', 'Test\\Entity1'));
     $configManager = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Config\\ConfigManager')->disableOriginalConstructor()->getMock();
     $ownershipConfigProvider = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Provider\\ConfigProvider')->disableOriginalConstructor()->getMock();
     $configManager->expects($this->once())->method('getProvider')->with('ownership')->will($this->returnValue($ownershipConfigProvider));
     $ownershipConfigProvider->expects($this->once())->method('hasConfig')->with('Test\\Entity1')->will($this->returnValue(true));
     $ownershipConfigProvider->expects($this->once())->method('getConfig')->with('Test\\Entity1')->will($this->returnValue($config));
     $configManager->expects($this->never())->method('persist');
     $this->subscriber->prePersistEntityConfig(new PersistConfigEvent($config, $configManager));
 }
예제 #2
0
 public function testPrePersistEntityConfigNotOwnershipScope()
 {
     $config = new Config(new EntityConfigId('test', 'Test\\Entity1'));
     $this->configManager->expects($this->never())->method('persist');
     $this->subscriber->prePersistEntityConfig(new PersistConfigEvent($config, $this->configManager));
 }