update v1.0.4

This commit is contained in:
sujitprasad
2016-01-04 18:05:45 +05:30
parent 372485336b
commit 4864e5a3f1
529 changed files with 20956 additions and 8178 deletions

View File

@@ -58,10 +58,8 @@ class InlineTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('1.2', Inline::dump(1.2));
$this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0)));
} finally {
setlocale(LC_NUMERIC, $locale);
} catch (\Exception $e) {
setlocale(LC_NUMERIC, $locale);
throw $e;
}
}
@@ -72,6 +70,23 @@ class InlineTest extends \PHPUnit_Framework_TestCase
$this->assertSame($value, Inline::parse(Inline::dump($value)));
}
/**
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
* @expectedExceptionMessage Found unknown escape character "\V".
*/
public function testParseScalarWithNonEscapedBlackslashShouldThrowException()
{
Inline::parse('"Foo\Var"');
}
/**
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
*/
public function testParseScalarWithNonEscapedBlackslashAtTheEndShouldThrowException()
{
Inline::parse('"Foo\\"');
}
/**
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
*/
@@ -173,6 +188,36 @@ class InlineTest extends \PHPUnit_Framework_TestCase
Inline::parse('{ foo: * #foo }');
}
/**
* @dataProvider getReservedIndicators
* @expectedException Symfony\Component\Yaml\Exception\ParseException
* @expectedExceptionMessage cannot start a plain scalar; you need to quote the scalar.
*/
public function testParseUnquotedScalarStartingWithReservedIndicator($indicator)
{
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
}
public function getReservedIndicators()
{
return array(array('@'), array('`'));
}
/**
* @dataProvider getScalarIndicators
* @expectedException Symfony\Component\Yaml\Exception\ParseException
* @expectedExceptionMessage cannot start a plain scalar; you need to quote the scalar.
*/
public function testParseUnquotedScalarStartingWithScalarIndicator($indicator)
{
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
}
public function getScalarIndicators()
{
return array(array('|'), array('>'));
}
public function getTestsForParse()
{
return array(