You are here

protected function GraphTest::displayArray in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 187
Contains \Drupal\Tests\Component\Graph\GraphTest.

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)';
  }
}