Documentation

ParserTest extends TestCase
in package

Table of Contents

$parser  : Parser
circularReferenceProvider()  : mixed
deprecatedObjectValueProvider()  : mixed
getBinaryData()  : mixed
getBlockChompingTests()  : mixed
getCommentLikeStringInScalarBlockData()  : mixed
getDataFormSpecifications()  : mixed
getInvalidBinaryData()  : mixed
getLegacyNonStringMappingKeysData()  : mixed
getNonStringMappingKeysData()  : mixed
getObjectForMapTests()  : mixed
getParseExceptionNotAffectedMultiLineStringLastResortParsing()  : mixed
getParseExceptionOnDuplicateData()  : mixed
indentedMappingData()  : mixed
invalidDumpedObjectProvider()  : mixed
multiLineDataProvider()  : mixed
parserThrowsExceptionWithCorrectLineNumberProvider()  : mixed
taggedValuesProvider()  : mixed
testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks()  : mixed
testBackslashInQuotedMultiLineString()  : mixed
testBlankLinesAreParsedAsNewLinesInFoldedBlocks()  : mixed
testBlankLinesInQuotedMultiLineString()  : mixed
testBlockChomping()  : mixed
testBlockLiteralWithLeadingNewlines()  : mixed
Regression test for issue #7989.
testBooleanKeys()  : mixed
testCanParseContentWithTrailingSpaces()  : mixed
testCanParseVeryLongValue()  : mixed
testColonInMappingValueException()  : mixed
testColonInMappingValueExceptionNotTriggeredByColonInComment()  : mixed
testCommentAtTheRootIndent()  : mixed
testCommentCharactersInMultiLineQuotedStrings()  : mixed
testCommentLikeStringsAreNotStrippedInBlockScalars()  : mixed
testComplexMappingNestedInMappingThrowsParseException()  : mixed
testComplexMappingNestedInSequenceThrowsParseException()  : mixed
testComplexMappingThrowsParseException()  : mixed
testCustomTagsDisabled()  : mixed
testCustomTagSupport()  : mixed
testDeprecatedPhpConstantTagMappingKey()  : mixed
testDetectCircularReferences()  : mixed
testEmptyValue()  : mixed
testEndOfTheDocumentMarker()  : mixed
testEscapedQuoteInQuotedMultiLineString()  : mixed
testEvalRefException()  : mixed
testExceptionWhenUsingUnsupportedBuiltInTags()  : mixed
testExplicitStringCasting()  : mixed
testFilenamesAreParsedAsStringsWithoutFlag()  : mixed
testFloatKeys()  : mixed
testFoldedStringBlockWithComments()  : mixed
testLegacyNonStringMappingKeys()  : mixed
testMappingDuplicateKeyBlock()  : mixed
> It is an error for two equal keys to appear in the same mapping node.
testMappingDuplicateKeyFlow()  : mixed
testMappingInASequence()  : mixed
testMergeKeysWhenMappingsAreParsedAsObjects()  : mixed
testMultiLineComment()  : mixed
testMultiLineQuotedStringWithTrailingBackslash()  : mixed
testMultiLineStringLastResortParsing()  : mixed
testMultipleDocumentsNotSupportedException()  : mixed
testNestedFoldedStringBlockWithComments()  : mixed
testNonStringFollowedByCommentEmbeddedInMapping()  : mixed
testNonStringMappingKeys()  : mixed
testNonUtf8Exception()  : mixed
testObjectForMap()  : mixed
testObjectForMapEnabledWithMappingUsingBooleanToggles()  : mixed
testObjectsSupportDisabledWithExceptions()  : mixed
testObjectsSupportDisabledWithExceptionsUsingBooleanToggles()  : mixed
testObjectSupportDisabledButNoExceptions()  : mixed
testObjectSupportEnabled()  : mixed
testObjectSupportEnabledPassingTrue()  : mixed
testObjectSupportEnabledWithDeprecatedTag()  : mixed
testParseBinaryData()  : mixed
testParseDateAsMappingValue()  : mixed
testParseExceptionNotAffectedByMultiLineStringLastResortParsing()  : mixed
testParseExceptionOnDuplicate()  : mixed
testParseFile()  : mixed
testParseIndentedMappings()  : mixed
testParseInvalidBinaryData()  : mixed
testParseMultiLineMappingValue()  : mixed
testParseMultiLineQuotedString()  : mixed
testParseMultiLineString()  : mixed
testParseMultiLineUnquotedString()  : mixed
testParserCleansUpReferencesBetweenRuns()  : mixed
testParseReferencesOnMergeKeys()  : mixed
testParseReferencesOnMergeKeysWithMappingsParsedAsObjects()  : mixed
testParserThrowsExceptionWithCorrectLineNumber()  : mixed
testParseValueWithModifiers()  : mixed
testParseValueWithNegativeModifiers()  : mixed
testParsingIniThrowsException()  : mixed
testParsingMultipleDocuments()  : mixed
This is a regression test for a bug where a YAML block with a nested multiline string using | was parsed without a trailing \n when a shorter YAML document was parsed before.
testParsingNonExistentFilesThrowsException()  : mixed
testParsingNotReadableFilesThrowsException()  : mixed
testPhpConstantTagMappingAsScalarKey()  : mixed
testPhpConstantTagMappingKey()  : mixed
testPhpConstantTagMappingKeyWithKeysCastToStrings()  : mixed
testReferenceResolvingInInlineStrings()  : mixed
testScalarInSequence()  : mixed
testSequenceFollowedByCommentEmbeddedInMapping()  : mixed
testSequenceInAMapping()  : mixed
testSequenceInMappingStartedBySingleDashLine()  : mixed
testShortcutKeyUnindentedCollectionException()  : mixed
testSpecifications()  : mixed
testStringBlockWithComments()  : mixed
testTabsInYaml()  : mixed
testTaggedInlineMapping()  : mixed
testTagMappingAsScalarKey()  : mixed
testUnindentedCollectionException()  : mixed
testUnsupportedTagWithScalar()  : mixed
testYamlDirective()  : mixed
setUp()  : mixed
tearDown()  : mixed
loadTestsFromFixtureFiles()  : mixed

Properties

Methods

circularReferenceProvider()

public circularReferenceProvider() : mixed
Return values
mixed

deprecatedObjectValueProvider()

public deprecatedObjectValueProvider() : mixed
Return values
mixed

getBinaryData()

public getBinaryData() : mixed
Return values
mixed

getBlockChompingTests()

public getBlockChompingTests() : mixed
Return values
mixed

getCommentLikeStringInScalarBlockData()

public getCommentLikeStringInScalarBlockData() : mixed
Return values
mixed

getDataFormSpecifications()

public getDataFormSpecifications() : mixed
Return values
mixed

getInvalidBinaryData()

public getInvalidBinaryData() : mixed
Return values
mixed

getLegacyNonStringMappingKeysData()

public getLegacyNonStringMappingKeysData() : mixed
Return values
mixed

getNonStringMappingKeysData()

public getNonStringMappingKeysData() : mixed
Return values
mixed

getObjectForMapTests()

public getObjectForMapTests() : mixed
Return values
mixed

getParseExceptionNotAffectedMultiLineStringLastResortParsing()

public getParseExceptionNotAffectedMultiLineStringLastResortParsing() : mixed
Return values
mixed

getParseExceptionOnDuplicateData()

public getParseExceptionOnDuplicateData() : mixed
Return values
mixed

indentedMappingData()

public indentedMappingData() : mixed
Return values
mixed

invalidDumpedObjectProvider()

public invalidDumpedObjectProvider() : mixed
Return values
mixed

multiLineDataProvider()

public multiLineDataProvider() : mixed
Return values
mixed

parserThrowsExceptionWithCorrectLineNumberProvider()

public parserThrowsExceptionWithCorrectLineNumberProvider() : mixed
Return values
mixed

taggedValuesProvider()

public taggedValuesProvider() : mixed
Return values
mixed

testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks()

public testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() : mixed
Return values
mixed

testBackslashInQuotedMultiLineString()

public testBackslashInQuotedMultiLineString() : mixed
Return values
mixed

testBlankLinesAreParsedAsNewLinesInFoldedBlocks()

public testBlankLinesAreParsedAsNewLinesInFoldedBlocks() : mixed
Return values
mixed

testBlankLinesInQuotedMultiLineString()

public testBlankLinesInQuotedMultiLineString() : mixed
Return values
mixed

testBlockChomping()

public testBlockChomping(mixed $expected, mixed $yaml) : mixed
Parameters
$expected : mixed
$yaml : mixed
Tags
dataProvider

getBlockChompingTests

Return values
mixed

testBooleanKeys()

public testBooleanKeys() : mixed
Tags
group

legacy

expectedDeprecation

Implicit casting of non-string key to string is deprecated since Symfony 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead on line 1.

Return values
mixed

testCanParseContentWithTrailingSpaces()

public testCanParseContentWithTrailingSpaces() : mixed
Return values
mixed

testCanParseVeryLongValue()

public testCanParseVeryLongValue() : mixed
Return values
mixed

testColonInMappingValueException()

public testColonInMappingValueException() : mixed
Return values
mixed

testColonInMappingValueExceptionNotTriggeredByColonInComment()

public testColonInMappingValueExceptionNotTriggeredByColonInComment() : mixed
Return values
mixed

testCommentAtTheRootIndent()

public testCommentAtTheRootIndent() : mixed
Return values
mixed

testCommentCharactersInMultiLineQuotedStrings()

public testCommentCharactersInMultiLineQuotedStrings() : mixed
Return values
mixed

testCommentLikeStringsAreNotStrippedInBlockScalars()

public testCommentLikeStringsAreNotStrippedInBlockScalars(mixed $yaml, mixed $expectedParserResult) : mixed
Parameters
$yaml : mixed
$expectedParserResult : mixed
Tags
dataProvider

getCommentLikeStringInScalarBlockData

Return values
mixed

testComplexMappingNestedInMappingThrowsParseException()

public testComplexMappingNestedInMappingThrowsParseException() : mixed
Tags
group

legacy

expectedDeprecation

Starting an unquoted string with a question mark followed by a space is deprecated since Symfony 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line 2.

Return values
mixed

testComplexMappingNestedInSequenceThrowsParseException()

public testComplexMappingNestedInSequenceThrowsParseException() : mixed
Tags
group

legacy

expectedDeprecation

Starting an unquoted string with a question mark followed by a space is deprecated since Symfony 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line 1.

Return values
mixed

testComplexMappingThrowsParseException()

public testComplexMappingThrowsParseException() : mixed
Tags
group

legacy

expectedDeprecation

Starting an unquoted string with a question mark followed by a space is deprecated since Symfony 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line 1.

Return values
mixed

testCustomTagsDisabled()

public testCustomTagsDisabled() : mixed
Return values
mixed

testCustomTagSupport()

public testCustomTagSupport(mixed $expected, mixed $yaml) : mixed
Parameters
$expected : mixed
$yaml : mixed
Tags
dataProvider

taggedValuesProvider

Return values
mixed

testDeprecatedPhpConstantTagMappingKey()

public testDeprecatedPhpConstantTagMappingKey() : mixed
Tags
group

legacy

expectedDeprecation

The !php/const: tag to indicate dumped PHP constants is deprecated since Symfony 3.4 and will be removed in 4.0. Use the !php/const (without the colon) tag instead on line 2.

expectedDeprecation

The !php/const: tag to indicate dumped PHP constants is deprecated since Symfony 3.4 and will be removed in 4.0. Use the !php/const (without the colon) tag instead on line 4.

expectedDeprecation

The !php/const: tag to indicate dumped PHP constants is deprecated since Symfony 3.4 and will be removed in 4.0. Use the !php/const (without the colon) tag instead on line 5.

Return values
mixed

testDetectCircularReferences()

public testDetectCircularReferences(mixed $yaml) : mixed
Parameters
$yaml : mixed
Tags
dataProvider

circularReferenceProvider

Return values
mixed

testEmptyValue()

public testEmptyValue() : mixed
Return values
mixed

testEndOfTheDocumentMarker()

public testEndOfTheDocumentMarker() : mixed
Return values
mixed

testEscapedQuoteInQuotedMultiLineString()

public testEscapedQuoteInQuotedMultiLineString() : mixed
Return values
mixed

testEvalRefException()

public testEvalRefException() : mixed
Return values
mixed

testExceptionWhenUsingUnsupportedBuiltInTags()

public testExceptionWhenUsingUnsupportedBuiltInTags() : mixed
Return values
mixed

testExplicitStringCasting()

public testExplicitStringCasting() : mixed
Return values
mixed

testFilenamesAreParsedAsStringsWithoutFlag()

public testFilenamesAreParsedAsStringsWithoutFlag() : mixed
Return values
mixed

testFloatKeys()

public testFloatKeys() : mixed
Tags
group

legacy

expectedDeprecation

Implicit casting of numeric key to string is deprecated since Symfony 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead on line 2.

Return values
mixed

testFoldedStringBlockWithComments()

public testFoldedStringBlockWithComments() : mixed
Return values
mixed

testLegacyNonStringMappingKeys()

public testLegacyNonStringMappingKeys(mixed $expected, mixed $yaml, mixed $comment) : mixed
Parameters
$expected : mixed
$yaml : mixed
$comment : mixed
Tags
group

legacy

dataProvider

getLegacyNonStringMappingKeysData

Return values
mixed

testMappingDuplicateKeyBlock()

> It is an error for two equal keys to appear in the same mapping node.

public testMappingDuplicateKeyBlock() : mixed

In such a case the YAML processor may continue, ignoring the second key: value pair and issuing an appropriate warning. This strategy preserves a consistent information model for one-pass and random access applications.

Tags
see
http://yaml.org/spec/1.2/spec.html#id2759572
see
http://yaml.org/spec/1.1/#id932806
group

legacy

Return values
mixed

testMappingDuplicateKeyFlow()

public testMappingDuplicateKeyFlow() : mixed
Tags
group

legacy

Return values
mixed

testMappingInASequence()

public testMappingInASequence() : mixed
Return values
mixed

testMergeKeysWhenMappingsAreParsedAsObjects()

public testMergeKeysWhenMappingsAreParsedAsObjects() : mixed
Return values
mixed

testMultiLineComment()

public testMultiLineComment() : mixed
Return values
mixed

testMultiLineQuotedStringWithTrailingBackslash()

public testMultiLineQuotedStringWithTrailingBackslash() : mixed
Return values
mixed

testMultiLineStringLastResortParsing()

public testMultiLineStringLastResortParsing() : mixed
Return values
mixed

testMultipleDocumentsNotSupportedException()

public testMultipleDocumentsNotSupportedException() : mixed
Return values
mixed

testNestedFoldedStringBlockWithComments()

public testNestedFoldedStringBlockWithComments() : mixed
Return values
mixed

testNonStringFollowedByCommentEmbeddedInMapping()

public testNonStringFollowedByCommentEmbeddedInMapping() : mixed
Return values
mixed

testNonStringMappingKeys()

public testNonStringMappingKeys(mixed $expected, mixed $yaml, mixed $comment) : mixed
Parameters
$expected : mixed
$yaml : mixed
$comment : mixed
Tags
group

legacy

expectedDeprecationMessage

Using the Yaml::PARSE_KEYS_AS_STRINGS flag is deprecated since Symfony 3.4 as it will be removed in 4.0. Quote your keys when they are evaluable

dataProvider

getNonStringMappingKeysData

Return values
mixed

testNonUtf8Exception()

public testNonUtf8Exception() : mixed
Tags
requires

extension iconv

Return values
mixed

testObjectForMap()

public testObjectForMap(mixed $yaml, mixed $expected) : mixed
Parameters
$yaml : mixed
$expected : mixed
Tags
dataProvider

getObjectForMapTests

Return values
mixed

testObjectForMapEnabledWithMappingUsingBooleanToggles()

public testObjectForMapEnabledWithMappingUsingBooleanToggles(mixed $yaml, mixed $expected) : mixed
Parameters
$yaml : mixed
$expected : mixed
Tags
group

legacy

dataProvider

getObjectForMapTests

Return values
mixed

testObjectsSupportDisabledWithExceptions()

public testObjectsSupportDisabledWithExceptions(mixed $yaml) : mixed
Parameters
$yaml : mixed
Tags
dataProvider

invalidDumpedObjectProvider

Return values
mixed

testObjectsSupportDisabledWithExceptionsUsingBooleanToggles()

public testObjectsSupportDisabledWithExceptionsUsingBooleanToggles(mixed $yaml) : mixed
Parameters
$yaml : mixed
Tags
group

legacy

dataProvider

invalidDumpedObjectProvider

Return values
mixed

testObjectSupportDisabledButNoExceptions()

public testObjectSupportDisabledButNoExceptions(mixed $input) : mixed
Parameters
$input : mixed
Tags
dataProvider

invalidDumpedObjectProvider

Return values
mixed

testObjectSupportEnabled()

public testObjectSupportEnabled() : mixed
Return values
mixed

testObjectSupportEnabledPassingTrue()

public testObjectSupportEnabledPassingTrue() : mixed
Tags
group

legacy

Return values
mixed

testObjectSupportEnabledWithDeprecatedTag()

public testObjectSupportEnabledWithDeprecatedTag(mixed $yaml) : mixed
Parameters
$yaml : mixed
Tags
group

legacy

dataProvider

deprecatedObjectValueProvider

Return values
mixed

testParseBinaryData()

public testParseBinaryData(mixed $data) : mixed
Parameters
$data : mixed
Tags
dataProvider

getBinaryData

Return values
mixed

testParseDateAsMappingValue()

public testParseDateAsMappingValue() : mixed
Return values
mixed

testParseExceptionNotAffectedByMultiLineStringLastResortParsing()

public testParseExceptionNotAffectedByMultiLineStringLastResortParsing(mixed $yaml) : mixed
Parameters
$yaml : mixed
Tags
dataProvider

getParseExceptionNotAffectedMultiLineStringLastResortParsing

Return values
mixed

testParseExceptionOnDuplicate()

public testParseExceptionOnDuplicate(mixed $input, mixed $duplicateKey, mixed $lineNumber) : mixed
Parameters
$input : mixed
$duplicateKey : mixed
$lineNumber : mixed
Tags
group

legacy

dataProvider

getParseExceptionOnDuplicateData

expectedDeprecation

Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated %s and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line %d. throws \Symfony\Component\Yaml\Exception\ParseException in 4.0

Return values
mixed

testParseFile()

public testParseFile() : mixed
Return values
mixed

testParseIndentedMappings()

public testParseIndentedMappings(mixed $yaml, mixed $expected) : mixed
Parameters
$yaml : mixed
$expected : mixed
Tags
dataProvider

indentedMappingData

Return values
mixed

testParseInvalidBinaryData()

public testParseInvalidBinaryData(mixed $data, mixed $expectedMessage) : mixed
Parameters
$data : mixed
$expectedMessage : mixed
Tags
dataProvider

getInvalidBinaryData

Return values
mixed

testParseMultiLineMappingValue()

public testParseMultiLineMappingValue(mixed $yaml, mixed $expected, mixed $parseError) : mixed
Parameters
$yaml : mixed
$expected : mixed
$parseError : mixed
Tags
dataProvider

multiLineDataProvider

Return values
mixed

testParseMultiLineQuotedString()

public testParseMultiLineQuotedString() : mixed
Return values
mixed

testParseMultiLineString()

public testParseMultiLineString() : mixed
Return values
mixed

testParseMultiLineUnquotedString()

public testParseMultiLineUnquotedString() : mixed
Return values
mixed

testParserCleansUpReferencesBetweenRuns()

public testParserCleansUpReferencesBetweenRuns() : mixed
Return values
mixed

testParseReferencesOnMergeKeys()

public testParseReferencesOnMergeKeys() : mixed
Return values
mixed

testParseReferencesOnMergeKeysWithMappingsParsedAsObjects()

public testParseReferencesOnMergeKeysWithMappingsParsedAsObjects() : mixed
Return values
mixed

testParserThrowsExceptionWithCorrectLineNumber()

public testParserThrowsExceptionWithCorrectLineNumber( $lineNumber,  $yaml) : mixed
Parameters
$lineNumber :
$yaml :
Tags
dataProvider

parserThrowsExceptionWithCorrectLineNumberProvider

Return values
mixed

testParseValueWithModifiers()

public testParseValueWithModifiers() : mixed
Return values
mixed

testParseValueWithNegativeModifiers()

public testParseValueWithNegativeModifiers() : mixed
Return values
mixed

testParsingIniThrowsException()

public testParsingIniThrowsException() : mixed
Return values
mixed

testParsingMultipleDocuments()

This is a regression test for a bug where a YAML block with a nested multiline string using | was parsed without a trailing \n when a shorter YAML document was parsed before.

public testParsingMultipleDocuments() : mixed

When a shorter document was parsed before, the nested string did not have a \n at the end of the string, because the Parser thought it was the end of the file, even though it is not.

Return values
mixed

testParsingNonExistentFilesThrowsException()

public testParsingNonExistentFilesThrowsException() : mixed
Return values
mixed

testParsingNotReadableFilesThrowsException()

public testParsingNotReadableFilesThrowsException() : mixed
Return values
mixed

testPhpConstantTagMappingAsScalarKey()

public testPhpConstantTagMappingAsScalarKey() : mixed
Return values
mixed

testPhpConstantTagMappingKey()

public testPhpConstantTagMappingKey() : mixed
Return values
mixed

testPhpConstantTagMappingKeyWithKeysCastToStrings()

public testPhpConstantTagMappingKeyWithKeysCastToStrings() : mixed
Tags
group

legacy

expectedDeprecation

Using the Yaml::PARSE_KEYS_AS_STRINGS flag is deprecated since Symfony 3.4 as it will be removed in 4.0. Quote your keys when they are evaluable instead.

Return values
mixed

testReferenceResolvingInInlineStrings()

public testReferenceResolvingInInlineStrings() : mixed
Return values
mixed

testScalarInSequence()

public testScalarInSequence() : mixed
Return values
mixed

testSequenceFollowedByCommentEmbeddedInMapping()

public testSequenceFollowedByCommentEmbeddedInMapping() : mixed
Return values
mixed

testSequenceInAMapping()

public testSequenceInAMapping() : mixed
Return values
mixed

testSequenceInMappingStartedBySingleDashLine()

public testSequenceInMappingStartedBySingleDashLine() : mixed
Return values
mixed

testShortcutKeyUnindentedCollectionException()

public testShortcutKeyUnindentedCollectionException() : mixed
Return values
mixed

testSpecifications()

public testSpecifications(mixed $expected, mixed $yaml, mixed $comment, mixed $deprecated) : mixed
Parameters
$expected : mixed
$yaml : mixed
$comment : mixed
$deprecated : mixed
Tags
dataProvider

getDataFormSpecifications

Return values
mixed

testStringBlockWithComments()

public testStringBlockWithComments() : mixed
Return values
mixed

testTabsInYaml()

public testTabsInYaml() : mixed
Return values
mixed

testTaggedInlineMapping()

public testTaggedInlineMapping() : mixed
Return values
mixed

testTagMappingAsScalarKey()

public testTagMappingAsScalarKey() : mixed
Return values
mixed

testUnindentedCollectionException()

public testUnindentedCollectionException() : mixed
Return values
mixed

testUnsupportedTagWithScalar()

public testUnsupportedTagWithScalar() : mixed
Tags
group

legacy

expectedDeprecation

Using the unquoted scalar value "!iterator foo" is deprecated since Symfony 3.3 and will be considered as a tagged value in 4.0. You must quote it on line 1.

Return values
mixed

testYamlDirective()

public testYamlDirective() : mixed
Return values
mixed

setUp()

protected setUp() : mixed
Return values
mixed

tearDown()

protected tearDown() : mixed
Return values
mixed

loadTestsFromFixtureFiles()

private loadTestsFromFixtureFiles(mixed $testsFile) : mixed
Parameters
$testsFile : mixed
Return values
mixed

Search results