Merge branch '3.0'
* 3.0: [Form] [ChoiceType] Prefer placeholder to empty_value Add missing RFC comment ensure dump indentation to be greather than zero
This commit is contained in:
commit
b0b2ddcfe8
@ -1435,7 +1435,7 @@ class ChoiceTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
|
||||
));
|
||||
$view = $form->createView();
|
||||
|
||||
$this->assertEquals($viewValue, $view->vars['placeholder']);
|
||||
$this->assertSame($viewValue, $view->vars['placeholder']);
|
||||
$this->assertFalse($view->vars['placeholder_in_choices']);
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ class Response
|
||||
428 => 'Precondition Required', // RFC6585
|
||||
429 => 'Too Many Requests', // RFC6585
|
||||
431 => 'Request Header Fields Too Large', // RFC6585
|
||||
451 => 'Unavailable For Legal Reasons',
|
||||
451 => 'Unavailable For Legal Reasons', // RFC7725
|
||||
500 => 'Internal Server Error',
|
||||
501 => 'Not Implemented',
|
||||
502 => 'Bad Gateway',
|
||||
|
@ -30,6 +30,10 @@ class Dumper
|
||||
*/
|
||||
public function __construct($indentation = 4)
|
||||
{
|
||||
if ($indentation < 1) {
|
||||
throw new \InvalidArgumentException('The indentation must be greater than zero.');
|
||||
}
|
||||
|
||||
$this->indentation = $indentation;
|
||||
}
|
||||
|
||||
|
@ -347,6 +347,24 @@ EOF;
|
||||
|
||||
$this->assertSame(file_get_contents(__DIR__.'/Fixtures/multiple_lines_as_literal_block.yml'), $this->dumper->dump($data, 3, 0, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The indentation must be greater than zero
|
||||
*/
|
||||
public function testZeroIndentationThrowsException()
|
||||
{
|
||||
new Dumper(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The indentation must be greater than zero
|
||||
*/
|
||||
public function testNegativeIndentationThrowsException()
|
||||
{
|
||||
new Dumper(-4);
|
||||
}
|
||||
}
|
||||
|
||||
class A
|
||||
|
@ -22,4 +22,22 @@ class YamlTest extends \PHPUnit_Framework_TestCase
|
||||
$parsed = Yaml::parse($yml);
|
||||
$this->assertEquals($data, $parsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The indentation must be greater than zero
|
||||
*/
|
||||
public function testZeroIndentationThrowsException()
|
||||
{
|
||||
Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The indentation must be greater than zero
|
||||
*/
|
||||
public function testNegativeIndentationThrowsException()
|
||||
{
|
||||
Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, -4);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user