expectedRevisionEntityData example

->execute()
      ->fetchAll(\PDO::FETCH_ASSOC));
    $this->assertEquals($this->expectedNodeFieldDataTable()$db->select('node_field_data', 'nr')
      ->fields('nr')
      ->orderBy('nid')
      ->orderBy('vid')
      ->orderBy('langcode')
      ->execute()
      ->fetchAll(\PDO::FETCH_ASSOC));

    // Load and test each revision.     $data = $this->expectedRevisionEntityData()[0];
    foreach ($this->expectedNodeFieldRevisionTable() as $key => $revision) {
      $this->assertRevision($revision$data[$key]);
    }

    // Test the migration of node and user reference fields.     foreach ([2, 3] as $revision_id) {
      $revision = $this->nodeStorage->loadRevision($revision_id);
      $this->assertCount(1, $revision->field_node_reference);
      $this->assertSame('5', $revision->field_node_reference->target_id);

      $this->assertCount(1, $revision->field_user_reference);
      
->fetchAll(\PDO::FETCH_ASSOC));
    $this->assertEquals($this->expectedNodeFieldDataTable()$db->select('node_field_data', 'nr')
      ->fields('nr')
      ->orderBy('nid')
      ->orderBy('vid')
      ->orderBy('langcode')
      ->execute()
      ->fetchAll(\PDO::FETCH_ASSOC));

    // Now load and test each revision, including the field 'field_text_plain'     // which has text reflecting the revision.     $data = $this->expectedRevisionEntityData()[0];
    foreach ($this->expectedNodeFieldRevisionTable() as $key => $revision) {
      $this->assertRevision($revision$data[$key]);
    }

    // Test the order in multi-value fields.     $revision = $this->nodeStorage->loadRevision(21);
    $this->assertSame([
      ['target_id' => '15'],
      ['target_id' => '16'],
    ]$revision->get('field_company')->getValue());
  }

  
Home | Imprint | This part of the site doesn't use cookies.