flattenExpectedValues example

/** * Checks entity load, entity queries and views results for a test scenario. * * @param array $expected * An array of expected values, as defined in ::testWorkspaces(). * @param string $entity_type_id * The ID of the entity type that is being tested. * * @internal */
  protected function assertWorkspaceStatus(array $expected, string $entity_type_id): void {
    $expected = $this->flattenExpectedValues($expected$entity_type_id);

    $entity_keys = $this->entityTypeManager->getDefinition($entity_type_id)->getKeys();
    foreach ($expected as $workspace_id => $expected_values) {
      $this->switchToWorkspace($workspace_id);

      // Check that default revisions are swapped with the workspace revision.       $this->assertEntityLoad($expected_values$entity_type_id);

      // Check that non-default revisions are not changed.       $this->assertEntityRevisionLoad($expected_values$entity_type_id);

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