restoreShortcodesInEntity() public method

Translates VPIDs to IDs in shortcodes for an entity
public restoreShortcodesInEntity ( string $entityName, array $entity ) : array
$entityName string
$entity array Entity data, see {@link WpdbMirrorBridge}
return array Entity data
 /**
  * @test
  * @dataProvider shortcodeProvider
  */
 public function replacerRestoresIdsFromVpidsInEntity($expectedReplacedOutput, $input)
 {
     $shortcodesReplacer = new ShortcodesReplacer($this->shortcodesInfo, $this->vpidRepository);
     $testingPost = ['post_title' => $input, 'post_content' => $input];
     $expectedPost = ['post_title' => $input, 'post_content' => $expectedReplacedOutput];
     $entityWithReplacedShortCodes = $shortcodesReplacer->restoreShortcodesInEntity('post', $testingPost);
     $this->assertEquals($expectedPost, $entityWithReplacedShortCodes);
 }
 private function restoreShortcodesInAllEntities()
 {
     foreach ($this->entities as $entity) {
         $replacedEntity = $this->shortcodesReplacer->restoreShortcodesInEntity($this->entityName, $entity);
         if ($entity != $replacedEntity) {
             $this->updateEntityInDatabase($replacedEntity);
         }
     }
 }