/** * @param string $entityType * @param object $entity * @return bool */ public function execute($entityType, $entity) { $hydrator = $this->metadataPool->getHydrator($entityType); $entityData = $hydrator->extract($entity); return $this->deleteEntityRow->execute($entityType, $entityData); }
public function testExecute() { $data = ['entity_id' => 1]; $this->connection->expects($this->once())->method('delete')->with('entity_table', ['entity_id = ?' => 1]); $this->subject->execute('Test\\Entity\\Type', $data); }