function GraphTest::displayArray

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Graph/GraphTest.php \Drupal\Tests\Component\Graph\GraphTest::displayArray()
  2. 8.9.x core/tests/Drupal/Tests/Component/Graph/GraphTest.php \Drupal\Tests\Component\Graph\GraphTest::displayArray()
  3. 11.x core/tests/Drupal/Tests/Component/Graph/GraphTest.php \Drupal\Tests\Component\Graph\GraphTest::displayArray()

Helper function to output vertices as comma-separated list.

Parameters

$paths: An array containing a list of vertices.

$keys: (optional) Whether to output the keys of $paths instead of the values.

3 calls to GraphTest::displayArray()
GraphTest::assertComponents in core/tests/Drupal/Tests/Component/Graph/GraphTest.php
Verify expected components in a graph.
GraphTest::assertPaths in core/tests/Drupal/Tests/Component/Graph/GraphTest.php
Verify expected paths in a graph.
GraphTest::assertReversePaths in core/tests/Drupal/Tests/Component/Graph/GraphTest.php
Verify expected reverse paths in a graph.

File

core/tests/Drupal/Tests/Component/Graph/GraphTest.php, line 194

Class

GraphTest
@coversDefaultClass \Drupal\Component\Graph\Graph @group Graph

Namespace

Drupal\Tests\Component\Graph

Code

protected function displayArray($paths, $keys = FALSE) {
    if (!empty($paths)) {
        return implode(', ', $keys ? array_keys($paths) : $paths);
    }
    else {
        return '(empty)';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.