10000 merged branch jakzal/bugfix/di-tests-segfault (PR #8298) · symfony/symfony@e01c6c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit e01c6c2

Browse files
committed
merged branch jakzal/bugfix/di-tests-segfault (PR #8298)
This PR was merged into the 2.3 branch. Discussion ---------- [DependencyInjection] Replaced try/catch block with an @ExpectedException annotation | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This fix doesn't seem like changing anything but thanks to it, PHP 5.3.3 stops segfaulting. Tests started failing after merging #8285. However, it's not the change which made them failing (the change is totally unrelated to the segfaulting test case). I suspect it has something to do with memory management in the early PHP 5.3 versions. We've had this kind of failures in the past. Commits ------- 494e803 [DependencyInjection] Replaced try/catch block with an @ExpectedException annotation in a test.
2 parents caaaec3 + 494e803 commit e01c6c2

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,25 @@ public function testIniFileCanBeLoaded()
5050
/**
5151
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct
5252
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load
53+
*
54+
* @expectedException \InvalidArgumentException
55+
* @expectedExceptionMessage The file "foo.ini" does not exist (in:
5356
*/
5457
public function testExceptionIsRaisedWhenIniFileDoesNotExist()
5558
{
56-
try {
57-
$this->loader->load('foo.ini');
58-
$this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist');
59-
} catch (\Exception $e) {
60-
$this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist');
61-
$this->assertStringStartsWith('The file "foo.ini" does not exist (in: ', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist');
62-
}
59+
$this->loader->load('foo.ini');
6360
}
6461

6562
/**
6663
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct
6764
* @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load
65+
*
66+
* @expectedException \InvalidArgumentException
67+
* @expectedExceptionMessage The "nonvalid.ini" file is not valid.
6868
*/
6969
public function testExceptionIsRaisedWhenIniFileCannotBeParsed()
7070
{
71-
try {
72-
@$this->loader->load('nonvalid.ini');
73-
$this->fail('->load() throws an InvalidArgumentException if the loaded file is not parseable');
74-
} catch (\Exception $e) {
75-
$this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file is not parseable');
76-
$this->assertEquals('The "nonvalid.ini" file is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file is not parseable');
77-
}
71+
@$this->loader->load('nonvalid.ini');
7872
}
7973

8074
/**

0 commit comments

Comments
 (0)
0