/** * @param ChannelBeforeDeleteEvent $event */ public function onChannelBeforeDelete(ChannelBeforeDeleteEvent $event) { /** @var Channel $channel */ $channel = $event->getChannel(); $dataSource = $channel->getDataSource(); if ($dataSource) { $this->manager->delete($dataSource); } }
public function testDeleteIntegrationWithErrors() { $this->em->expects($this->any())->method('remove')->with($this->equalTo($this->testIntegration))->will($this->throwException(new \Exception())); $this->connection->expects($this->once())->method('rollback'); $this->assertFalse($this->deleteManager->delete($this->testIntegration)); }