You are here

public function InlineTest::getTestsForParseWithMapObjects in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/yaml/Tests/InlineTest.php \Symfony\Component\Yaml\Tests\InlineTest::getTestsForParseWithMapObjects()

File

vendor/symfony/yaml/Tests/InlineTest.php, line 251

Class

InlineTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function getTestsForParseWithMapObjects() {
  return array(
    array(
      '',
      '',
    ),
    array(
      'null',
      null,
    ),
    array(
      'false',
      false,
    ),
    array(
      'true',
      true,
    ),
    array(
      '12',
      12,
    ),
    array(
      '-12',
      -12,
    ),
    array(
      '"quoted string"',
      'quoted string',
    ),
    array(
      "'quoted string'",
      'quoted string',
    ),
    array(
      '12.30e+02',
      1230.0,
    ),
    array(
      '0x4D2',
      0x4d2,
    ),
    array(
      '02333',
      02333,
    ),
    array(
      '.Inf',
      -log(0),
    ),
    array(
      '-.Inf',
      log(0),
    ),
    array(
      "'686e444'",
      '686e444',
    ),
    array(
      '686e444',
      \INF,
    ),
    array(
      '123456789123456789123456789123456789',
      '123456789123456789123456789123456789',
    ),
    array(
      '"foo\\r\\nbar"',
      "foo\r\nbar",
    ),
    array(
      "'foo#bar'",
      'foo#bar',
    ),
    array(
      "'foo # bar'",
      'foo # bar',
    ),
    array(
      "'#cfcfcf'",
      '#cfcfcf',
    ),
    array(
      '::form_base.html.twig',
      '::form_base.html.twig',
    ),
    array(
      '2007-10-30',
      mktime(0, 0, 0, 10, 30, 2007),
    ),
    array(
      '2007-10-30T02:59:43Z',
      gmmktime(2, 59, 43, 10, 30, 2007),
    ),
    array(
      '2007-10-30 02:59:43 Z',
      gmmktime(2, 59, 43, 10, 30, 2007),
    ),
    array(
      '1960-10-30 02:59:43 Z',
      gmmktime(2, 59, 43, 10, 30, 1960),
    ),
    array(
      '1730-10-30T02:59:43Z',
      gmmktime(2, 59, 43, 10, 30, 1730),
    ),
    array(
      '"a \\"string\\" with \'quoted strings inside\'"',
      'a "string" with \'quoted strings inside\'',
    ),
    array(
      "'a \"string\" with ''quoted strings inside'''",
      'a "string" with \'quoted strings inside\'',
    ),
    // sequences
    // urls are no key value mapping. see #3609. Valid yaml "key: value" mappings require a space after the colon
    array(
      '[foo, http://urls.are/no/mappings, false, null, 12]',
      array(
        'foo',
        'http://urls.are/no/mappings',
        false,
        null,
        12,
      ),
    ),
    array(
      '[  foo  ,   bar , false  ,  null     ,  12  ]',
      array(
        'foo',
        'bar',
        false,
        null,
        12,
      ),
    ),
    array(
      '[\'foo,bar\', \'foo bar\']',
      array(
        'foo,bar',
        'foo bar',
      ),
    ),
    // mappings
    array(
      '{foo:bar,bar:foo,false:false,null:null,integer:12}',
      (object) array(
        'foo' => 'bar',
        'bar' => 'foo',
        'false' => false,
        'null' => null,
        'integer' => 12,
      ),
    ),
    array(
      '{ foo  : bar, bar : foo,  false  :   false,  null  :   null,  integer :  12  }',
      (object) array(
        'foo' => 'bar',
        'bar' => 'foo',
        'false' => false,
        'null' => null,
        'integer' => 12,
      ),
    ),
    array(
      '{foo: \'bar\', bar: \'foo: bar\'}',
      (object) array(
        'foo' => 'bar',
        'bar' => 'foo: bar',
      ),
    ),
    array(
      '{\'foo\': \'bar\', "bar": \'foo: bar\'}',
      (object) array(
        'foo' => 'bar',
        'bar' => 'foo: bar',
      ),
    ),
    array(
      '{\'foo\'\'\': \'bar\', "bar\\"": \'foo: bar\'}',
      (object) array(
        'foo\'' => 'bar',
        'bar"' => 'foo: bar',
      ),
    ),
    array(
      '{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}',
      (object) array(
        'foo: ' => 'bar',
        'bar: ' => 'foo: bar',
      ),
    ),
    // nested sequences and mappings
    array(
      '[foo, [bar, foo]]',
      array(
        'foo',
        array(
          'bar',
          'foo',
        ),
      ),
    ),
    array(
      '[foo, {bar: foo}]',
      array(
        'foo',
        (object) array(
          'bar' => 'foo',
        ),
      ),
    ),
    array(
      '{ foo: {bar: foo} }',
      (object) array(
        'foo' => (object) array(
          'bar' => 'foo',
        ),
      ),
    ),
    array(
      '{ foo: [bar, foo] }',
      (object) array(
        'foo' => array(
          'bar',
          'foo',
        ),
      ),
    ),
    array(
      '[  foo, [  bar, foo  ]  ]',
      array(
        'foo',
        array(
          'bar',
          'foo',
        ),
      ),
    ),
    array(
      '[{ foo: {bar: foo} }]',
      array(
        (object) array(
          'foo' => (object) array(
            'bar' => 'foo',
          ),
        ),
      ),
    ),
    array(
      '[foo, [bar, [foo, [bar, foo]], foo]]',
      array(
        'foo',
        array(
          'bar',
          array(
            'foo',
            array(
              'bar',
              'foo',
            ),
          ),
          'foo',
        ),
      ),
    ),
    array(
      '[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]',
      array(
        'foo',
        (object) array(
          'bar' => 'foo',
          'foo' => array(
            'foo',
            (object) array(
              'bar' => 'foo',
            ),
          ),
        ),
        array(
          'foo',
          (object) array(
            'bar' => 'foo',
          ),
        ),
      ),
    ),
    array(
      '[foo, bar: { foo: bar }]',
      array(
        'foo',
        '1' => (object) array(
          'bar' => (object) array(
            'foo' => 'bar',
          ),
        ),
      ),
    ),
    array(
      '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']',
      array(
        'foo',
        '@foo.baz',
        (object) array(
          '%foo%' => 'foo is %foo%',
          'bar' => '%foo%',
        ),
        true,
        '@service_container',
      ),
    ),
    array(
      '{}',
      new \stdClass(),
    ),
    array(
      '{ foo  : bar, bar : {}  }',
      (object) array(
        'foo' => 'bar',
        'bar' => new \stdClass(),
      ),
    ),
    array(
      '{ foo  : [], bar : {}  }',
      (object) array(
        'foo' => array(),
        'bar' => new \stdClass(),
      ),
    ),
    array(
      '{foo: \'bar\', bar: {} }',
      (object) array(
        'foo' => 'bar',
        'bar' => new \stdClass(),
      ),
    ),
    array(
      '{\'foo\': \'bar\', "bar": {}}',
      (object) array(
        'foo' => 'bar',
        'bar' => new \stdClass(),
      ),
    ),
    array(
      '{\'foo\': \'bar\', "bar": \'{}\'}',
      (object) array(
        'foo' => 'bar',
        'bar' => '{}',
      ),
    ),
    array(
      '[foo, [{}, {}]]',
      array(
        'foo',
        array(
          new \stdClass(),
          new \stdClass(),
        ),
      ),
    ),
    array(
      '[foo, [[], {}]]',
      array(
        'foo',
        array(
          array(),
          new \stdClass(),
        ),
      ),
    ),
    array(
      '[foo, [[{}, {}], {}]]',
      array(
        'foo',
        array(
          array(
            new \stdClass(),
            new \stdClass(),
          ),
          new \stdClass(),
        ),
      ),
    ),
    array(
      '[foo, {bar: {}}]',
      array(
        'foo',
        '1' => (object) array(
          'bar' => new \stdClass(),
        ),
      ),
    ),
  );
}