getNumberOfChangesOnTarget example

'local_1' => [3, 5, 7],
      'local_2' => [3, 5],
      'qa' => [],
    ];
    $this->assertWorkspaceAssociation($expected_workspace_association, 'node');

    /** @var \Drupal\workspaces\WorkspaceMergerInterface $workspace_merger */
    $workspace_merger = \Drupal::service('workspaces.operation_factory')->getMerger($this->workspaces['local_1']$this->workspaces['dev']);

    // Check that there is no content in Dev that's not also in Local 1.     $this->assertEmpty($workspace_merger->getDifferringRevisionIdsOnTarget());
    $this->assertEquals(0, $workspace_merger->getNumberOfChangesOnTarget());

    // Check that there is only one node in Local 1 that's not available in Dev,     // revision 7 created above for the fourth test article.     $expected = [
      'node' => [7 => 4],
    ];
    $this->assertEquals($expected$workspace_merger->getDifferringRevisionIdsOnSource());
    $this->assertEquals(1, $workspace_merger->getNumberOfChangesOnSource());

    // Merge the contents of Local 1 into Dev, and check that Dev, Local 1 and     // Local 2 have the same content.
Home | Imprint | This part of the site doesn't use cookies.