Lines Matching +full:n +full:- +full:one

27         $this->parser = new Parser();
32 $this->parser = null;
42 $this->assertEquals($expected, var_export($this->parser->parse($yaml), true), $comment);
47 return $this->loadTestsFromFixtureFiles('index.yml');
52 return $this->loadTestsFromFixtureFiles('nonStringKeys.yml');
59 "foo:\n bar",
60 "foo:\n bar",
61 "foo:\n bar",
62 "foo:\n bar",
67 $content = $this->parser->parse($yaml);
69 $this->fail('YAML files must not contain tabs');
71 $this->assertInstanceOf('\Exception', $e, 'YAML files must not contain tabs');
72 …$this->assertEquals('A YAML file cannot contain tabs as indentation at line 2 (near "'.strpbrk($ya…
80 --- %YAML:1.0
85 $this->assertEquals('foo', $this->parser->parse($yaml));
93 foo: |-
94 one
96 bar: |-
97 one
102 'foo' => "one\ntwo",
103 'bar' => "one\ntwo",
108 foo: |-
109 one
112 bar: |-
113 one
119 'foo' => "one\ntwo",
120 'bar' => "one\ntwo",
130 …$tests['Literal block chomping strip with multiple trailing newlines after a 1-liner'] = [$expecte…
133 foo: |-
134 one
136 bar: |-
137 one
141 'foo' => "one\ntwo",
142 'bar' => "one\ntwo",
148 one
151 one
156 'foo' => "one\ntwo\n",
157 'bar' => "one\ntwo\n",
163 one
167 one
173 'foo' => "one\ntwo\n",
174 'bar' => "one\ntwo\n",
180 - bar: |
181 one
188 'bar' => "one\n\ntwo",
196 one
199 one
203 'foo' => "one\ntwo\n",
204 'bar' => "one\ntwo",
210 one
213 one
218 'foo' => "one\ntwo\n",
219 'bar' => "one\ntwo\n",
225 one
229 one
235 'foo' => "one\ntwo\n\n",
236 'bar' => "one\ntwo\n\n",
242 one
245 one
249 'foo' => "one\ntwo\n",
250 'bar' => "one\ntwo",
255 foo: >-
256 one
258 bar: >-
259 one
264 'foo' => 'one two',
265 'bar' => 'one two',
270 foo: >-
271 one
274 bar: >-
275 one
281 'foo' => 'one two',
282 'bar' => 'one two',
287 foo: >-
288 one
290 bar: >-
291 one
295 'foo' => 'one two',
296 'bar' => 'one two',
302 one
305 one
310 'foo' => "one two\n",
311 'bar' => "one two\n",
317 one
321 one
327 'foo' => "one two\n",
328 'bar' => "one two\n",
334 one
337 one
341 'foo' => "one two\n",
342 'bar' => 'one two',
348 one
351 one
356 'foo' => "one two\n",
357 'bar' => "one two\n",
363 one
367 one
373 'foo' => "one two\n\n",
374 'bar' => "one two\n\n",
380 one
383 one
387 'foo' => "one two\n",
388 'bar' => 'one two',
400 $this->assertSame($expected, $this->parser->parse($yaml));
411 foo: |-
418 'foo' => "\n\nbar",
421 $this->assertSame($expected, $this->parser->parse($yaml));
430 …$this->assertEquals(['foo' => new B(), 'bar' => 1], $this->parser->parse($input, Yaml::PARSE_OBJEC…
439 …$this->assertEquals(['foo' => null, 'bar' => 1], $this->parser->parse($input), '->parse() does not…
449 $this->assertEquals($expected, $this->parser->parse($yaml, $flags));
461 $expected->foo = new \stdClass();
462 $expected->foo->fiz = ['cat'];
467 $expected->foo = 'bar';
468 $expected->fiz = 'cat';
469 $tests['inline-mapping'] = [$yaml, $expected];
473 $expected->foo = 'bar';
474 $expected->baz = 'foobar';
475 $tests['object-for-map-is-applied-after-parsing'] = [$yaml, $expected];
479 - key: one
480 - key: two
483 $expected->array = [];
484 $expected->array[0] = new \stdClass();
485 $expected->array[0]->key = 'one';
486 $expected->array[1] = new \stdClass();
487 $expected->array[1]->key = 'two';
488 $tests['nest-map-and-sequence'] = [$yaml, $expected];
492 1: one
496 $expected->map = new \stdClass();
497 $expected->map->{1} = 'one';
498 $expected->map->{2} = 'two';
499 $tests['numeric-keys'] = [$yaml, $expected];
503 '0': one
507 $expected->map = new \stdClass();
508 $expected->map->{0} = 'one';
509 $expected->map->{1} = 'two';
510 $tests['zero-indexed-numeric-keys'] = [$yaml, $expected];
525 $this->parser->parse($yaml, Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE);
530 $yaml = "items: \n foo: bar";
536 $this->assertSame($expected, $this->parser->parse($yaml));
545 iconv('UTF-8', 'ISO-8859-1', "foo: 'äöüß'"),
546 iconv('UTF-8', 'ISO-8859-15', "euro: '€'"),
547 iconv('UTF-8', 'CP1252', "cp1252: '©ÉÇáñ'"),
552 $this->parser->parse($yaml);
554 $this->fail('charsets other than UTF-8 are rejected.');
556 …$this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other tha…
569 -item1
570 -item2
571 -item3
575 $this->parser->parse($yaml);
586 - key: foo
591 $this->parser->parse($yaml);
602 ---
603 - Mark McGwire
604 - Sammy Sosa
605 - Ken Griffey
608 ---
609 - Chicago Cubs
610 - St Louis Cardinals
623 - array stuff
632 -
634 -
636 - foo
653 $this->assertSame($expected, $this->parser->parse($yaml));
661 - c
672 $this->assertSame($expected, $this->parser->parse($yaml));
693 $this->assertSame($expected, $this->parser->parse($yaml));
715 & * ! | > ' " % @ ` #, { asd a;sdasd }-@^qw3
717 $tests['symfony/symfony/issues/22967#issuecomment-322067742'] = [$yaml];
728 $this->parser->parse($yaml);
743 $this->assertSame($expected, $this->parser->parse($yaml));
754 $this->assertSame($expected, $this->parser->parse($yaml));
764 - array stuff
778 - bar
792 * > preserves a consistent information model for one-pass and random access
813 $this->assertSame($expected, Yaml::parse($input));
831 $this->assertSame($expected, Yaml::parse($input));
840 …$this->expectExceptionMessage(sprintf('Duplicate key "%s" detected at line %d', $duplicateKey, $li…
889 - key1
890 - key2
891 - key3
893 - key1
894 - key2
895 - key3
908 $this->assertEquals(['hash' => null], Yaml::parse($input));
913 $this->assertEquals([
939 $this->assertEquals(['content' => <<<'EOT'
967 $this->assertEquals([['content' => <<<'EOT'
979 -
996 $this->assertEquals([[
1010 -
1028 $this->assertEquals([
1029 'var' => 'var-value',
1030 'scalar' => 'var-value',
1031 'list' => ['var-value'],
1032 'list_in_list' => [['var-value']],
1033 'map_in_list' => [['key' => 'var-value']],
1034 'embedded_mapping' => [['key' => 'var-value']],
1035 'map' => ['key' => 'var-value'],
1036 'list_in_map' => ['key' => ['var-value']],
1037 'map_in_map' => ['foo' => ['bar' => 'var-value']],
1039 var: &var var-value
1056 ---
1060 $this->assertEquals(['foo' => 1, 'bar' => 2], $this->parser->parse($yaml));
1075 $this->parser->parse($yaml);
1080 …* @expectedExceptionMessage Non-string keys are not supported. Quote your evaluable mapping keys i…
1089 $this->parser->parse($yaml);
1114 $this->assertEquals($expected, $this->parser->parse($yaml));
1127 $this->parser->parse($yaml);
1137 $this->assertSame(['foo' => ['bar' => 'foobar']], $this->parser->parse($yaml));
1145 $this->assertSame($expectedParserResult, $this->parser->parse($yaml));
1154 -
1194 - one: |
1198 - two: |
1213 'one' => <<<'EOT'
1236 scalar-block: >
1246 'scalar-block' => "line1 line2>\n",
1286 $this->assertSame(
1294 $this->parser->parse($yaml)
1310 $this->assertSame(
1321 $this->parser->parse($yaml)
1330 $this->assertSame(['data' => 'Hello world'], $this->parser->parse($data));
1361 $this->expectExceptionMessageRegExp($expectedMessage);
1363 $this->setExpectedExceptionRegExp(ParseException::class, $expectedMessage);
1366 $this->parser->parse($data);
1414 date: 2002-12-14
1417 $expectedDate->setTimeZone(new \DateTimeZone('UTC'));
1418 $expectedDate->setDate(2002, 12, 14);
1419 $expectedDate->setTime(0, 0, 0);
1421 … $this->assertEquals(['date' => $expectedDate], $this->parser->parse($yaml, Yaml::PARSE_DATETIME));
1432 $this->expectException('\Symfony\Component\Yaml\Exception\ParseException');
1433 …$this->expectExceptionMessage(sprintf('Unexpected characters near "," at line %d (near "bar: "123"…
1435 …$this->setExpectedException('\Symfony\Component\Yaml\Exception\ParseException', sprintf('Unexpecte…
1438 $this->parser->parse($yaml);
1448 -
1457 -
1467 -
1471 -
1480 -
1485 -
1504 … $this->assertSame(['foo' => 'bar baz foobar foo', 'bar' => 'baz'], $this->parser->parse($yaml));
1515 $this->assertSame(['foobar' => 'foobar'], $this->parser->parse($yaml));
1533 $this->assertSame($expected, $this->parser->parse($yaml));
1547 $this->assertSame($expected, $this->parser->parse($yaml));
1560 … $this->assertSame(['foo' => 'bar baz foobar foo', 'bar' => 'baz'], $this->parser->parse($yaml));
1565 $this->assertEquals("foo bar\nbaz", $this->parser->parse("foo\nbar\n\nbaz"));
1573 $this->assertEquals($expected, $this->parser->parse($yaml));
1582 - bar:
1583 one
1591 'bar' => "one\ntwo three",
1619 $expected = "bar\n'foo'";
1637 …$this->assertEquals(new TaggedValue('foo', ['foo' => 'bar']), $this->parser->parse('!foo {foo: bar…
1645 $this->assertEquals($expected, $this->parser->parse($yaml, Yaml::PARSE_CUSTOM_TAGS));
1666 - !foo
1667 - yaml
1668 - !quz [bar]
1681 …r']), new TaggedValue('quz', ['foo' => 'bar', 'quz' => new TaggedValue('bar', ['one' => 'bar'])])],
1683 - !foo [foo, bar]
1684 - !quz {foo: bar, quz: !bar {one: bar}}
1687 'spaces-around-tag-value-in-sequence' => [
1696 $this->assertSame('12', $this->parser->parse('! 12'));
1705 $this->parser->parse('!iterator [foo]');
1714 $this->parser->parse('!iterator foo');
1719 … string "!!iterator foo" could not be parsed as it uses an unsupported built-in tag at line 1 (nea…
1723 $this->parser->parse('!!iterator foo');
1728 … * @expectedExceptionMessage The built-in tag "!!foo" is not implemented at line 1 (near "!!foo").
1732 $this->parser->parse('!!foo');
1747 $this->parser->parse($yaml);
1763 $this->parser->parse($yaml);
1768 * @expectedExceptionMessage Complex mappings are not supported at line 1 (near "- ? "1"").
1773 - ? "1"
1778 $this->parser->parse($yaml);
1793 $this->parser->parse($ini);
1801 $files = $parser->parseFile(__DIR__.'/Fixtures/'.$testsFile);
1806 foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) {
1811 $test = $parser->parse($yaml);
1831 $arrayFromYaml = $this->parser->parse($yamlString);
1833 $this->assertEquals($trickyVal, $arrayFromYaml);
1848 $this->parser->parse($yaml);
1854 $this->parser->parse($yaml);
1863 - !php/const 'Symfony\Component\Yaml\Tests\B::BAR'
1877 $this->assertSame($expected, $this->parser->parse($yaml, Yaml::PARSE_CONSTANT));
1914 $this->assertEquals($expected, $this->parser->parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));
1921 $this->assertSame($file, $this->parser->parse($file));
1926 $this->assertInternalType('array', $this->parser->parseFile(__DIR__.'/Fixtures/index.yml'));
1935 $this->parser->parseFile(__DIR__.'/Fixtures/nonexistent.yml');
1945 $this->markTestSkipped('chmod is not supported on Windows');
1949 $this->markTestSkipped('This test will fail if run under superuser');
1955 $this->parser->parseFile($file);
1983 $this->assertSame($expected, $this->parser->parse($yaml));
2011 $this->assertEquals($expected, $this->parser->parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));
2023 $this->parser->parse($yaml);
2033 $this->parser->parse($yaml, Yaml::PARSE_CUSTOM_TAGS);
2042 - &foo
2043 - &bar
2073 $this->assertSame($expected, $this->parser->parse($yaml));
2082 - bar: "foobar"
2098 - bar:
2115 -