You are here

public function ParserTest::getInvalidBinaryData in Lockr 7.3

File

vendor/symfony/yaml/Tests/ParserTest.php, line 1497

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function getInvalidBinaryData() {
  return [
    'length not a multiple of four' => [
      'data: !!binary "SGVsbG8d29ybGQ="',
      '/The normalized base64 encoded data \\(data without whitespace characters\\) length must be a multiple of four \\(\\d+ bytes given\\)/',
    ],
    'invalid characters' => [
      '!!binary "SGVsbG8#d29ybGQ="',
      '/The base64 encoded data \\(.*\\) contains invalid characters/',
    ],
    'too many equals characters' => [
      'data: !!binary "SGVsbG8gd29yb==="',
      '/The base64 encoded data \\(.*\\) contains invalid characters/',
    ],
    'misplaced equals character' => [
      'data: !!binary "SGVsbG8gd29ybG=Q"',
      '/The base64 encoded data \\(.*\\) contains invalid characters/',
    ],
    'length not a multiple of four in block scalar' => [
      <<<'EOT'
data: !!binary |
    SGVsbG8d29ybGQ=
EOT
,
      '/The normalized base64 encoded data \\(data without whitespace characters\\) length must be a multiple of four \\(\\d+ bytes given\\)/',
    ],
    'invalid characters in block scalar' => [
      <<<'EOT'
data: !!binary |
    SGVsbG8#d29ybGQ=
EOT
,
      '/The base64 encoded data \\(.*\\) contains invalid characters/',
    ],
    'too many equals characters in block scalar' => [
      <<<'EOT'
data: !!binary |
    SGVsbG8gd29yb===
EOT
,
      '/The base64 encoded data \\(.*\\) contains invalid characters/',
    ],
    'misplaced equals character in block scalar' => [
      <<<'EOT'
data: !!binary |
    SGVsbG8gd29ybG=Q
EOT
,
      '/The base64 encoded data \\(.*\\) contains invalid characters/',
    ],
  ];
}