Skip to content

Commit ad2d6ef

Browse files
Merge branch '2.7' into 2.8
* 2.7: Further refactorings to PHPUnit namespaces resolve parameters in definition classes
2 parents 2463176 + 44214df commit ad2d6ef

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Tests/Catalogue/AbstractOperationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testGetMergedDomains()
4141

4242
public function testGetMessagesFromUnknownDomain()
4343
{
44-
$this->setExpectedException('InvalidArgumentException');
44+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
4545
$this->createOperation(
4646
new MessageCatalogue('en'),
4747
new MessageCatalogue('en')

Tests/Loader/QtFileLoaderTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,14 @@ public function testLoadEmptyResource()
6262
{
6363
$loader = new QtFileLoader();
6464
$resource = __DIR__.'/../fixtures/empty.xlf';
65-
$this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s".', $resource));
65+
66+
if (method_exists($this, 'expectException')) {
67+
$this->expectException('Symfony\Component\Translation\Exception\InvalidResourceException');
68+
$this->expectExceptionMessage(sprintf('Unable to load "%s".', $resource));
69+
} else {
70+
$this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s".', $resource));
71+
}
72+
6673
$loader->load($resource, 'en', 'domain1');
6774
}
6875
}

Tests/Loader/XliffFileLoaderTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,14 @@ public function testParseEmptyFile()
148148
{
149149
$loader = new XliffFileLoader();
150150
$resource = __DIR__.'/../fixtures/empty.xlf';
151-
$this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s":', $resource));
151+
152+
if (method_exists($this, 'expectException')) {
153+
$this->expectException('Symfony\Component\Translation\Exception\InvalidResourceException');
154+
$this->expectExceptionMessage(sprintf('Unable to load "%s":', $resource));
155+
} else {
156+
$this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s":', $resource));
157+
}
158+
152159
$loader->load($resource, 'en', 'domain1');
153160
}
154161

0 commit comments

Comments
 (0)