Documentation

ParserTest extends TestCase
in package

Table of Contents

Properties

$parser  : Parser

Methods

getBinaryData()  : mixed
getBlockChompingTests()  : mixed
getCommentLikeStringInScalarBlockData()  : mixed
getDataFormSpecifications()  : mixed
getInvalidBinaryData()  : mixed
getLegacyNonStringMappingKeysData()  : mixed
getNonStringMappingKeysData()  : mixed
getObjectForMapTests()  : mixed
getParseExceptionOnDuplicateData()  : mixed
invalidDumpedObjectProvider()  : mixed
multiLineDataProvider()  : mixed
parserThrowsExceptionWithCorrectLineNumberProvider()  : mixed
taggedValuesProvider()  : mixed
testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks()  : mixed
testBlankLinesAreParsedAsNewLinesInFoldedBlocks()  : mixed
testBlockChomping()  : mixed
testBlockLiteralWithLeadingNewlines()  : mixed
Regression test for issue #7989.
testBooleanKeys()  : mixed
testCanParseContentWithTrailingSpaces()  : mixed
testCanParseVeryLongValue()  : mixed
testColonInMappingValueException()  : mixed
testColonInMappingValueExceptionNotTriggeredByColonInComment()  : mixed
testCommentAtTheRootIndent()  : mixed
testCommentLikeStringsAreNotStrippedInBlockScalars()  : mixed
testComplexMappingNestedInMappingThrowsParseException()  : mixed
testComplexMappingNestedInSequenceThrowsParseException()  : mixed
testComplexMappingThrowsParseException()  : mixed
testCustomTagsDisabled()  : mixed
testCustomTagSupport()  : mixed
testEmptyValue()  : mixed
testEndOfTheDocumentMarker()  : mixed
testExceptionWhenUsingUnsuportedBuiltInTags()  : mixed
testExplicitStringCastingOfBooleanKeys()  : mixed
testExplicitStringCastingOfFloatKeys()  : 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
testMultipleDocumentsNotSupportedException()  : mixed
testNestedFoldedStringBlockWithComments()  : 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
testParseExceptionOnDuplicate()  : mixed
testParseInvalidBinaryData()  : mixed
testParseMultiLineMappingValue()  : mixed
testParseMultiLineQuotedString()  : mixed
testParseMultiLineString()  : mixed
testParseMultiLineUnquotedString()  : mixed
testParserCleansUpReferencesBetweenRuns()  : mixed
testParserThrowsExceptionWithCorrectLineNumber()  : mixed
testParsingIniThrowsException()  : 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
testUnindentedCollectionException()  : mixed
testUnsupportedTagWithScalar()  : mixed
testYamlDirective()  : mixed
setUp()  : mixed
tearDown()  : mixed
loadTestsFromFixtureFiles()  : mixed

Properties

Methods

getBinaryData()

public getBinaryData() : mixed

getBlockChompingTests()

public getBlockChompingTests() : mixed

getCommentLikeStringInScalarBlockData()

public getCommentLikeStringInScalarBlockData() : mixed

getDataFormSpecifications()

public getDataFormSpecifications() : mixed

getInvalidBinaryData()

public getInvalidBinaryData() : mixed

getLegacyNonStringMappingKeysData()

public getLegacyNonStringMappingKeysData() : mixed

getNonStringMappingKeysData()

public getNonStringMappingKeysData() : mixed

getObjectForMapTests()

public getObjectForMapTests() : mixed

getParseExceptionOnDuplicateData()

public getParseExceptionOnDuplicateData() : mixed

invalidDumpedObjectProvider()

public invalidDumpedObjectProvider() : mixed

multiLineDataProvider()

public multiLineDataProvider() : mixed

parserThrowsExceptionWithCorrectLineNumberProvider()

public parserThrowsExceptionWithCorrectLineNumberProvider() : mixed

taggedValuesProvider()

public taggedValuesProvider() : mixed

testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks()

public testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() : mixed

testBlankLinesAreParsedAsNewLinesInFoldedBlocks()

public testBlankLinesAreParsedAsNewLinesInFoldedBlocks() : mixed

testBlockChomping()

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

getBlockChompingTests

testBooleanKeys()

public testBooleanKeys() : mixed
Tags
group

legacy

expectedDeprecation

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

testCanParseContentWithTrailingSpaces()

public testCanParseContentWithTrailingSpaces() : mixed

testCanParseVeryLongValue()

public testCanParseVeryLongValue() : mixed

testColonInMappingValueException()

public testColonInMappingValueException() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

expectedExceptionMessage

A colon cannot be used in an unquoted mapping value

testColonInMappingValueExceptionNotTriggeredByColonInComment()

public testColonInMappingValueExceptionNotTriggeredByColonInComment() : mixed

testCommentAtTheRootIndent()

public testCommentAtTheRootIndent() : mixed

testCommentLikeStringsAreNotStrippedInBlockScalars()

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

getCommentLikeStringInScalarBlockData

testComplexMappingNestedInMappingThrowsParseException()

public testComplexMappingNestedInMappingThrowsParseException() : mixed
Tags
group

legacy

expectedDeprecation

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

testComplexMappingNestedInSequenceThrowsParseException()

public testComplexMappingNestedInSequenceThrowsParseException() : mixed
Tags
group

legacy

expectedDeprecation

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

testComplexMappingThrowsParseException()

public testComplexMappingThrowsParseException() : mixed
Tags
group

legacy

expectedDeprecation

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

testCustomTagsDisabled()

public testCustomTagsDisabled() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

expectedExceptionMessage

Tags support is not enabled. Enable the Yaml::PARSE_CUSTOM_TAGS flag to use "!iterator" at line 1 (near "!iterator [foo]").

testCustomTagSupport()

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

taggedValuesProvider

testEmptyValue()

public testEmptyValue() : mixed

testEndOfTheDocumentMarker()

public testEndOfTheDocumentMarker() : mixed

testExceptionWhenUsingUnsuportedBuiltInTags()

public testExceptionWhenUsingUnsuportedBuiltInTags() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

expectedExceptionMessage

The built-in tag "!!foo" is not implemented.

testExplicitStringCastingOfBooleanKeys()

public testExplicitStringCastingOfBooleanKeys() : mixed

testExplicitStringCastingOfFloatKeys()

public testExplicitStringCastingOfFloatKeys() : mixed

testFloatKeys()

public testFloatKeys() : mixed
Tags
group

legacy

expectedDeprecation

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

testFoldedStringBlockWithComments()

public testFoldedStringBlockWithComments() : mixed

testLegacyNonStringMappingKeys()

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

legacy

dataProvider

getLegacyNonStringMappingKeysData

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

testMappingDuplicateKeyFlow()

public testMappingDuplicateKeyFlow() : mixed
Tags
group

legacy

testMappingInASequence()

public testMappingInASequence() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

testMultipleDocumentsNotSupportedException()

public testMultipleDocumentsNotSupportedException() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

expectedExceptionMessageRegExp

/^Multiple documents are not supported.+/

testNestedFoldedStringBlockWithComments()

public testNestedFoldedStringBlockWithComments() : mixed

testNonStringMappingKeys()

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

getNonStringMappingKeysData

testNonUtf8Exception()

public testNonUtf8Exception() : mixed
Tags
requires

extension iconv

testObjectForMap()

public testObjectForMap(mixed $yaml, mixed $expected[, mixed $explicitlyParseKeysAsStrings = false ]) : mixed
Parameters
$yaml : mixed
$expected : mixed
$explicitlyParseKeysAsStrings : mixed = false
Tags
dataProvider

getObjectForMapTests

testObjectForMapEnabledWithMappingUsingBooleanToggles()

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

legacy

dataProvider

getObjectForMapTests

testObjectsSupportDisabledWithExceptions()

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

invalidDumpedObjectProvider

expectedException

\Symfony\Component\Yaml\Exception\ParseException

testObjectsSupportDisabledWithExceptionsUsingBooleanToggles()

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

legacy

dataProvider

invalidDumpedObjectProvider

expectedException

\Symfony\Component\Yaml\Exception\ParseException

testObjectSupportDisabledButNoExceptions()

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

invalidDumpedObjectProvider

testObjectSupportEnabled()

public testObjectSupportEnabled() : mixed

testObjectSupportEnabledPassingTrue()

public testObjectSupportEnabledPassingTrue() : mixed
Tags
group

legacy

testObjectSupportEnabledWithDeprecatedTag()

public testObjectSupportEnabledWithDeprecatedTag() : mixed
Tags
group

legacy

testParseBinaryData()

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

getBinaryData

testParseDateAsMappingValue()

public testParseDateAsMappingValue() : 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. throws \Symfony\Component\Yaml\Exception\ParseException in 4.0

testParseInvalidBinaryData()

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

getInvalidBinaryData

expectedException

\Symfony\Component\Yaml\Exception\ParseException

testParseMultiLineMappingValue()

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

multiLineDataProvider

testParseMultiLineQuotedString()

public testParseMultiLineQuotedString() : mixed

testParseMultiLineString()

public testParseMultiLineString() : mixed

testParseMultiLineUnquotedString()

public testParseMultiLineUnquotedString() : mixed

testParserCleansUpReferencesBetweenRuns()

public testParserCleansUpReferencesBetweenRuns() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

expectedExceptionMessage

Reference "foo" does not exist at line 2

testParserThrowsExceptionWithCorrectLineNumber()

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

parserThrowsExceptionWithCorrectLineNumberProvider

testParsingIniThrowsException()

public testParsingIniThrowsException() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

expectedExceptionMessage

Unable to parse at line 1 (near "[parameters]").

testPhpConstantTagMappingKey()

public testPhpConstantTagMappingKey() : mixed

testPhpConstantTagMappingKeyWithKeysCastToStrings()

public testPhpConstantTagMappingKeyWithKeysCastToStrings() : mixed

testReferenceResolvingInInlineStrings()

public testReferenceResolvingInInlineStrings() : mixed

testScalarInSequence()

public testScalarInSequence() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

expectedExceptionMessage

missing colon

testSequenceFollowedByCommentEmbeddedInMapping()

public testSequenceFollowedByCommentEmbeddedInMapping() : mixed

testSequenceInAMapping()

public testSequenceInAMapping() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

testSequenceInMappingStartedBySingleDashLine()

public testSequenceInMappingStartedBySingleDashLine() : mixed

testShortcutKeyUnindentedCollectionException()

public testShortcutKeyUnindentedCollectionException() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

testSpecifications()

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

getDataFormSpecifications

testStringBlockWithComments()

public testStringBlockWithComments() : mixed

testTabsInYaml()

public testTabsInYaml() : mixed

testTaggedInlineMapping()

public testTaggedInlineMapping() : mixed

testUnindentedCollectionException()

public testUnindentedCollectionException() : mixed
Tags
expectedException

\Symfony\Component\Yaml\Exception\ParseException

testUnsupportedTagWithScalar()

public testUnsupportedTagWithScalar() : mixed
Tags
group

legacy

expectedDeprecation

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

testYamlDirective()

public testYamlDirective() : mixed

loadTestsFromFixtureFiles()

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

        
On this page

Search results