You are here

public function InlineTest::testParseUnquotedScalarStartingWithScalarIndicator in Lockr 7.3

@dataProvider getScalarIndicators

File

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

Class

InlineTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testParseUnquotedScalarStartingWithScalarIndicator($indicator) {
  if (method_exists($this, 'expectExceptionMessage')) {
    $this
      ->expectException(ParseException::class);
    $this
      ->expectExceptionMessage(sprintf('cannot start a plain scalar; you need to quote the scalar at line 1 (near "%sfoo ").', $indicator));
  }
  else {
    $this
      ->setExpectedException(ParseException::class, sprintf('cannot start a plain scalar; you need to quote the scalar at line 1 (near "%sfoo ").', $indicator));
  }
  Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
}