public function InlineTest::testDump

File

drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php, line 26

Class

InlineTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testDump() {
  $testsForDump = $this
    ->getTestsForDump();
  foreach ($testsForDump as $yaml => $value) {
    $this
      ->assertEquals($yaml, Inline::dump($value), sprintf('::dump() converts a PHP structure to an inline YAML (%s)', $yaml));
  }
  foreach ($this
    ->getTestsForParse() as $yaml => $value) {
    $this
      ->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency');
  }
  foreach ($testsForDump as $yaml => $value) {
    $this
      ->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency');
  }
}