You are here

public function ParserTest::getBlockChompingTests in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/symfony/yaml/Tests/ParserTest.php \Symfony\Component\Yaml\Tests\ParserTest::getBlockChompingTests()

File

vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php, line 102

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function getBlockChompingTests() {
  $tests = array();
  $yaml = <<<'EOF'
foo: |-
    one
    two
bar: |-
    one
    two

EOF;
  $expected = array(
    'foo' => "one\ntwo",
    'bar' => "one\ntwo",
  );
  $tests['Literal block chomping strip with single trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |-
    one
    two

bar: |-
    one
    two


EOF;
  $expected = array(
    'foo' => "one\ntwo",
    'bar' => "one\ntwo",
  );
  $tests['Literal block chomping strip with multiple trailing newlines'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
{}


EOF;
  $expected = array();
  $tests['Literal block chomping strip with multiple trailing newlines after a 1-liner'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |-
    one
    two
bar: |-
    one
    two
EOF;
  $expected = array(
    'foo' => "one\ntwo",
    'bar' => "one\ntwo",
  );
  $tests['Literal block chomping strip without trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |
    one
    two
bar: |
    one
    two

EOF;
  $expected = array(
    'foo' => "one\ntwo\n",
    'bar' => "one\ntwo\n",
  );
  $tests['Literal block chomping clip with single trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |
    one
    two

bar: |
    one
    two


EOF;
  $expected = array(
    'foo' => "one\ntwo\n",
    'bar' => "one\ntwo\n",
  );
  $tests['Literal block chomping clip with multiple trailing newlines'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |
    one
    two
bar: |
    one
    two
EOF;
  $expected = array(
    'foo' => "one\ntwo\n",
    'bar' => "one\ntwo",
  );
  $tests['Literal block chomping clip without trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |+
    one
    two
bar: |+
    one
    two

EOF;
  $expected = array(
    'foo' => "one\ntwo\n",
    'bar' => "one\ntwo\n",
  );
  $tests['Literal block chomping keep with single trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |+
    one
    two

bar: |+
    one
    two


EOF;
  $expected = array(
    'foo' => "one\ntwo\n\n",
    'bar' => "one\ntwo\n\n",
  );
  $tests['Literal block chomping keep with multiple trailing newlines'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: |+
    one
    two
bar: |+
    one
    two
EOF;
  $expected = array(
    'foo' => "one\ntwo\n",
    'bar' => "one\ntwo",
  );
  $tests['Literal block chomping keep without trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >-
    one
    two
bar: >-
    one
    two

EOF;
  $expected = array(
    'foo' => 'one two',
    'bar' => 'one two',
  );
  $tests['Folded block chomping strip with single trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >-
    one
    two

bar: >-
    one
    two


EOF;
  $expected = array(
    'foo' => 'one two',
    'bar' => 'one two',
  );
  $tests['Folded block chomping strip with multiple trailing newlines'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >-
    one
    two
bar: >-
    one
    two
EOF;
  $expected = array(
    'foo' => 'one two',
    'bar' => 'one two',
  );
  $tests['Folded block chomping strip without trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >
    one
    two
bar: >
    one
    two

EOF;
  $expected = array(
    'foo' => "one two\n",
    'bar' => "one two\n",
  );
  $tests['Folded block chomping clip with single trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >
    one
    two

bar: >
    one
    two


EOF;
  $expected = array(
    'foo' => "one two\n",
    'bar' => "one two\n",
  );
  $tests['Folded block chomping clip with multiple trailing newlines'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >
    one
    two
bar: >
    one
    two
EOF;
  $expected = array(
    'foo' => "one two\n",
    'bar' => 'one two',
  );
  $tests['Folded block chomping clip without trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >+
    one
    two
bar: >+
    one
    two

EOF;
  $expected = array(
    'foo' => "one two\n",
    'bar' => "one two\n",
  );
  $tests['Folded block chomping keep with single trailing newline'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >+
    one
    two

bar: >+
    one
    two


EOF;
  $expected = array(
    'foo' => "one two\n\n",
    'bar' => "one two\n\n",
  );
  $tests['Folded block chomping keep with multiple trailing newlines'] = array(
    $expected,
    $yaml,
  );
  $yaml = <<<'EOF'
foo: >+
    one
    two
bar: >+
    one
    two
EOF;
  $expected = array(
    'foo' => "one two\n",
    'bar' => 'one two',
  );
  $tests['Folded block chomping keep without trailing newline'] = array(
    $expected,
    $yaml,
  );
  return $tests;
}