Skip to content

Commit 54fa2ff

Browse files
committed
minor symfony#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 ------- 86b685f fix risky tests
2 parents b89ed60 + 86b685f commit 54fa2ff

File tree

4 files changed

+33
-12
lines changed

4 files changed

+33
-12
lines changed

src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function tearDown()
3434
}
3535

3636
/**
37-
* @dataProvider testRenderProvider
37+
* @dataProvider renderProvider
3838
*/
3939
public function testRender($headers, $rows, $layout, $expected)
4040
{
@@ -50,7 +50,7 @@ public function testRender($headers, $rows, $layout, $expected)
5050
}
5151

5252
/**
53-
* @dataProvider testRenderProvider
53+
* @dataProvider renderProvider
5454
*/
5555
public function testRenderAddRows($headers, $rows, $layout, $expected)
5656
{
@@ -66,7 +66,7 @@ public function testRenderAddRows($headers, $rows, $layout, $expected)
6666
}
6767

6868
/**
69-
* @dataProvider testRenderProvider
69+
* @dataProvider renderProvider
7070
*/
7171
public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected)
7272
{
@@ -83,7 +83,7 @@ public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected)
8383
$this->assertEquals($expected, $this->getOutputContent($output));
8484
}
8585

86-
public function testRenderProvider()
86+
public function renderProvider()
8787
{
8888
$books = array(
8989
array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),

src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,10 @@ public function testProcessDoesNotTriggerDeprecations()
452452

453453
$pass = new AutowirePass();
454454
$pass->process($container);
455+
456+
$this->assertTrue($container->hasDefinition('deprecated'));
457+
$this->assertTrue($container->hasDefinition('foo'));
458+
$this->assertTrue($container->hasDefinition('bar'));
455459
}
456460

457461
public function testEmptyStringIsKept()

src/Symfony/Component/Intl/Tests/Locale/LocaleTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ public function testSetDefault()
153153
public function testSetDefaultAcceptsEn()
154154
{
155155
$this->call('setDefault', 'en');
156+
157+
$this->assertSame('en', $this->call('getDefault'));
156158
}
157159

158160
protected function call($methodName)

src/Symfony/Component/Yaml/Tests/InlineTest.php

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,27 +193,42 @@ public function testParseUnquotedAsteriskFollowedByAComment()
193193

194194
/**
195195
* @group legacy
196-
* @dataProvider getReservedIndicators
196+
* @expectedDeprecation Not quoting the scalar "@foo " starting with "@" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
197197
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
198198
*/
199-
public function testParseUnquotedScalarStartingWithReservedIndicator($indicator)
199+
public function testParseUnquotedScalarStartingWithReservedAtIndicator()
200200
{
201-
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
201+
Inline::parse('{ foo: @foo }');
202202
}
203203

204-
public function getReservedIndicators()
204+
/**
205+
* @group legacy
206+
* @expectedDeprecation Not quoting the scalar "`foo " starting with "`" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
207+
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
208+
*/
209+
public function testParseUnquotedScalarStartingWithReservedBacktickIndicator()
210+
{
211+
Inline::parse('{ foo: `foo }');
212+
}
213+
214+
/**
215+
* @group legacy
216+
* @expectedDeprecation Not quoting the scalar "|foo " starting with "|" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
217+
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
218+
*/
219+
public function testParseUnquotedScalarStartingWithLiteralStyleIndicator()
205220
{
206-
return array(array('@'), array('`'));
221+
Inline::parse('{ foo: |foo }');
207222
}
208223

209224
/**
210225
* @group legacy
211-
* @dataProvider getScalarIndicators
226+
* @expectedDeprecation Not quoting the scalar ">foo " starting with ">" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
212227
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
213228
*/
214-
public function testParseUnquotedScalarStartingWithScalarIndicator($indicator)
229+
public function testParseUnquotedScalarStartingWithFoldedStyleIndicator()
215230
{
216-
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
231+
Inline::parse('{ foo: >foo }');
217232
}
218233

219234
public function getScalarIndicators()

0 commit comments

Comments
 (0)