minor #22379 fix risky tests (xabbuh)

This PR was merged into the 2.8 branch.

Discussion
----------

fix risky tests

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

86b685f617 fix risky tests
This commit is contained in:
Fabien Potencier 2017-04-11 09:37:23 -07:00
commit 54fa2ff975
4 changed files with 36 additions and 15 deletions

View File

@ -34,7 +34,7 @@ class LegacyTableHelperTest extends TestCase
}
/**
* @dataProvider testRenderProvider
* @dataProvider renderProvider
*/
public function testRender($headers, $rows, $layout, $expected)
{
@ -50,7 +50,7 @@ class LegacyTableHelperTest extends TestCase
}
/**
* @dataProvider testRenderProvider
* @dataProvider renderProvider
*/
public function testRenderAddRows($headers, $rows, $layout, $expected)
{
@ -66,7 +66,7 @@ class LegacyTableHelperTest extends TestCase
}
/**
* @dataProvider testRenderProvider
* @dataProvider renderProvider
*/
public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected)
{
@ -83,7 +83,7 @@ class LegacyTableHelperTest extends TestCase
$this->assertEquals($expected, $this->getOutputContent($output));
}
public function testRenderProvider()
public function renderProvider()
{
$books = array(
array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),

View File

@ -452,6 +452,10 @@ class AutowirePassTest extends TestCase
$pass = new AutowirePass();
$pass->process($container);
$this->assertTrue($container->hasDefinition('deprecated'));
$this->assertTrue($container->hasDefinition('foo'));
$this->assertTrue($container->hasDefinition('bar'));
}
public function testEmptyStringIsKept()

View File

@ -153,6 +153,8 @@ class LocaleTest extends AbstractLocaleTest
public function testSetDefaultAcceptsEn()
{
$this->call('setDefault', 'en');
$this->assertSame('en', $this->call('getDefault'));
}
protected function call($methodName)

View File

@ -193,27 +193,42 @@ class InlineTest extends TestCase
/**
* @group legacy
* @dataProvider getReservedIndicators
* @expectedDeprecation Not quoting the scalar "@foo " starting with "@" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithReservedIndicator($indicator)
public function testParseUnquotedScalarStartingWithReservedAtIndicator()
{
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
}
public function getReservedIndicators()
{
return array(array('@'), array('`'));
Inline::parse('{ foo: @foo }');
}
/**
* @group legacy
* @dataProvider getScalarIndicators
* @expectedDeprecation Not quoting the scalar "`foo " starting with "`" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithScalarIndicator($indicator)
public function testParseUnquotedScalarStartingWithReservedBacktickIndicator()
{
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
Inline::parse('{ foo: `foo }');
}
/**
* @group legacy
* @expectedDeprecation Not quoting the scalar "|foo " starting with "|" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithLiteralStyleIndicator()
{
Inline::parse('{ foo: |foo }');
}
/**
* @group legacy
* @expectedDeprecation Not quoting the scalar ">foo " starting with ">" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithFoldedStyleIndicator()
{
Inline::parse('{ foo: >foo }');
}
public function getScalarIndicators()